Skip to content

Commit

Permalink
Merge pull request #411 from dfinity/ggreif/update-moc-0.7.0
Browse files Browse the repository at this point in the history
Update `moc` to 0.7.0
  • Loading branch information
ggreif authored and fury02 committed Aug 27, 2022
2 parents 73d34ad + 0c2eee4 commit 8940945
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
# Remember to update me in package-set.yml as well
env:
vessel_version: "v0.6.3"
moc_version: "0.6.30"
moc_version: "0.7.0"

jobs:
tests:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package-set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
vessel_version: "v0.6.3"
moc_version: "0.6.30"
moc_version: "0.7.0"

jobs:
verify:
Expand Down
12 changes: 8 additions & 4 deletions src/TrieSet.mo
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,18 @@ module {

/// Put an element into the set.
public func put<T>(s : Set<T>, x : T, xh : Hash, eq : (T, T) -> Bool) : Set<T> {
let (s2, _) = Trie.put<T,()>(s, { key = x; hash = xh }, eq, ());
s2
// let (s2, _) = Trie.put<T,()>(s, { key = x; hash = xh }, eq, ());
// s2
s := Trie.put<T,()>(s, { key = x; hash = xh x}, eq, ()).0;
s
};

/// Delete an element from the set.
public func delete<T>(s : Set<T>, x : T, xh : Hash, eq : (T, T) -> Bool) : Set<T> {
let (s2, _) = Trie.remove<T, ()>(s, { key = x; hash = xh }, eq);
s2
// let (s2, _) = Trie.remove<T, ()>(s, { key = x; hash = xh }, eq);
// s2
s := Trie.remove<T, ()>(s, { key = x; hash = xh}, eq).0;
s
};

/// Test if two sets are equal.
Expand Down

0 comments on commit 8940945

Please sign in to comment.