Skip to content

Commit

Permalink
avoid boxing (changes baseline)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusso committed Feb 14, 2024
1 parent 1b763c4 commit 77a920e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion collections/motoko/src/ZhenyaHashmap.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Prim "mo:prim";
actor {
stable let profiling = Profiling.init();

func f_hash(x : Nat64) : Nat32 = Prim.nat64ToNat32(x & 0xffffffff);
func f_hash(x : Nat64) : Nat32 = Hash.hash(Nat64.toNat x);
let hash : HashMap.HashUtils<Nat64> = (f_hash, Nat64.equal);
stable var map = HashMap.new<Nat64, Nat64>();
let rand = Random.new(null, 42);
Expand Down
2 changes: 1 addition & 1 deletion collections/motoko/src/random.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Prim "mo:⛔";

module {
public class new(size: ?Nat32, seed: Nat64) {
let modulus : Nat64 = 0x7fffffff;
let modulus : Nat64 = 0xfffffff; //0x7fffffff;
var state : Nat64 = seed;
var ind : Nat32 = 0;

Expand Down

0 comments on commit 77a920e

Please sign in to comment.