diff options
author | bptato <nincsnevem662@gmail.com> | 2024-04-26 16:19:09 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-04-26 16:24:27 +0200 |
commit | c1bcb8a4d833d035eb199546aabc44dbe10252c6 (patch) | |
tree | 4a2acaadf7f4ef4d4ccb32e3e6e558141d26d73e /src/js/fromjs.nim | |
parent | d93c5700d432afc265fab1fbfef663f77361635d (diff) | |
download | chawan-c1bcb8a4d833d035eb199546aabc44dbe10252c6.tar.gz |
Remove unnecessary unsigned casts
Unsigned operations and conversions to unsigned types always wrap/narrow without checks, so no need to manually mask/cast/etc. them.
Diffstat (limited to 'src/js/fromjs.nim')
-rw-r--r-- | src/js/fromjs.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js/fromjs.nim b/src/js/fromjs.nim index 4cdc18d1..527b6221 100644 --- a/src/js/fromjs.nim +++ b/src/js/fromjs.nim @@ -108,7 +108,7 @@ func fromJSInt[T: SomeInteger](ctx: JSContext; val: JSValue): var ret: uint32 if JS_ToUint32(ctx, addr ret, val) < 0: return err() - return ok(cast[uint64](ret)) + return ok(uint64(ret)) proc fromJSFloat64(ctx: JSContext; val: JSValue): JSResult[float64] = var f64: float64 |