mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
option: increase the temporary limit
This commit is contained in:
parent
cd49c2103b
commit
eb313ebb5b
@ -5,15 +5,15 @@
|
|||||||
module builtin
|
module builtin
|
||||||
|
|
||||||
struct Option {
|
struct Option {
|
||||||
data [255] byte
|
data [500]byte
|
||||||
error string
|
error string
|
||||||
ok bool
|
ok bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// `fn foo() ?Foo { return foo }` => `fn foo() ?Foo { return opt_ok(foo); }`
|
// `fn foo() ?Foo { return foo }` => `fn foo() ?Foo { return opt_ok(foo); }`
|
||||||
fn opt_ok(data voidptr, size int) Option {
|
fn opt_ok(data voidptr, size int) Option {
|
||||||
if size > 255 {
|
if size >= 500 {
|
||||||
panic('option size too big: $size (max is 255), this is a temporary limit')
|
panic('option size too big: $size (max is 500), this is a temporary limit')
|
||||||
}
|
}
|
||||||
res := Option {
|
res := Option {
|
||||||
ok: true
|
ok: true
|
||||||
|
Loading…
Reference in New Issue
Block a user