Skip to content

Commit 2664cba

Browse files
committed
use builtins
1 parent 07b115d commit 2664cba

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

packages/blake3-wasm/assembly/blake3.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,3 @@ function parent_cv(
351351
): StaticArray<u32> {
352352
return parent_output(left_child_cv, right_child_cv, key_words, flags).chaining_value();
353353
}
354-
355-
function min(a: usize, b: usize): usize {
356-
return a < b ? a : b;
357-
}

packages/xetchunk-wasm/assembly/xet-chunker.ts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -133,38 +133,3 @@ function computeDataHash(data: Uint8Array): Uint8Array {
133133
hasher.finalize(hash);
134134
return hash;
135135
}
136-
137-
// Helper function to find minimum of two numbers
138-
function min(a: usize, b: usize): usize {
139-
return a < b ? a : b;
140-
}
141-
142-
// Helper function to count leading zeros
143-
function clz(x: u64): u32 {
144-
let n: u32 = 0;
145-
if (x == 0) return 64;
146-
if ((x & 0xffffffff00000000) == 0) {
147-
n += 32;
148-
x <<= 32;
149-
}
150-
if ((x & 0xffff000000000000) == 0) {
151-
n += 16;
152-
x <<= 16;
153-
}
154-
if ((x & 0xff00000000000000) == 0) {
155-
n += 8;
156-
x <<= 8;
157-
}
158-
if ((x & 0xf000000000000000) == 0) {
159-
n += 4;
160-
x <<= 4;
161-
}
162-
if ((x & 0xc000000000000000) == 0) {
163-
n += 2;
164-
x <<= 2;
165-
}
166-
if ((x & 0x8000000000000000) == 0) {
167-
n += 1;
168-
}
169-
return n;
170-
}

0 commit comments

Comments
 (0)