Skip to content

Commit

Permalink
stable_structures clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Oct 4, 2023
1 parent 80a8937 commit 0bea1c8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/lib/stable_b_tree_map.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CandidType, TypeMapping, toIDLType } from './candid';
import { CandidType, TypeMapping } from './candid';
import { None, Opt, Some } from './candid/types/constructed/opt';
import { nat64 } from './candid/types/primitive/nats/nat64';
import { nat8 } from './candid/types/primitive/nats/nat8';
Expand All @@ -8,10 +8,7 @@ export function StableBTreeMap<
Key extends CandidType,
Value extends CandidType
>(keyType: Key, valueType: Value, memoryId: nat8) {
const keyIdl = toIDLType(keyType, []);
const valueIdl = toIDLType(valueType, []);

const candidEncodedMemoryId = new Uint8Array(encode(nat8, memoryId)).buffer;
const candidEncodedMemoryId = encode(nat8, memoryId).buffer;

if ((globalThis as any)._azleIc !== undefined) {
(globalThis as any)._azleIc.stableBTreeMapInit(candidEncodedMemoryId);
Expand Down

0 comments on commit 0bea1c8

Please sign in to comment.