Skip to content

Commit

Permalink
PersistentOrderedMap: fix typo in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
GoPavel committed Nov 5, 2024
1 parent a9b240e commit 879519c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/PersistentOrderedMap.mo
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ module {
/// Debug.print(debug_show(mapOps.maxEntry(mapOps.empty()))); // => null
/// ```
///
/// Runtime: `O(log(n))`
/// Runtime: `O(log(n))`.
/// Space: `O(1)`.
/// where `n` denotes the number of key-value entries stored in the map.
public func maxEntry<V>(m: Map<K, V>): ?(K, V)
Expand All @@ -270,7 +270,7 @@ module {
/// Debug.print(debug_show(mapOps.minEntry(mapOps.empty()))); // => null
/// ```
///
/// Runtime: `O(log(n))`
/// Runtime: `O(log(n))`.
/// Space: `O(1)`.
/// where `n` denotes the number of key-value entries stored in the map.
public func minEntry<V>(m: Map<K, V>): ?(K, V)
Expand Down Expand Up @@ -496,13 +496,11 @@ module {
/// let map = mapOps.fromIter<Text>(Iter.fromArray([(0, "Zero"), (2, "Two"), (1, "One")]));
///
/// Debug.print(debug_show(mapOps.size(map)));
///
/// // 3
/// ```
///
/// Runtime: `O(n)`.
/// Space: `O(1)`.
/// where `n` denotes the number of key-value entries stored in the tree.
public func size<V>(m : Map<K, V>) : Nat
= m.size;

Expand Down Expand Up @@ -579,7 +577,7 @@ module {
/// Test whether all key-value pairs satisfy a given predicate `pred`.
///
/// Example:
/// ```
/// ```motoko
/// import Map "mo:base/PersistentOrderedMap";
/// import Nat "mo:base/Nat";
/// import Debug "mo:base/Debug";
Expand All @@ -595,14 +593,14 @@ module {
///
/// Runtime: `O(n)`.
/// Space: `O(1)`.
/// where `n` denotes the number of key-value entries stored in the tree.
/// where `n` denotes the number of key-value entries stored in the map.
public func all<V>(m: Map<K, V>, pred: (K, V) -> Bool): Bool
= Internal.all(m.root, pred);

/// Test if there exists a key-value pair satisfying a given predicate `pred`.
///
/// Example:
/// ```
/// ```motoko
/// import Map "mo:base/PersistentOrderedMap";
/// import Nat "mo:base/Nat";
/// import Debug "mo:base/Debug";
Expand All @@ -618,7 +616,7 @@ module {
///
/// Runtime: `O(n)`.
/// Space: `O(1)`.
/// where `n` denotes the number of key-value entries stored in the tree.
/// where `n` denotes the number of key-value entries stored in the map.
public func some<V>(m: Map<K, V>, pred: (K, V) -> Bool): Bool
= Internal.some(m.root, pred);
};
Expand Down

0 comments on commit 879519c

Please sign in to comment.