Skip to content

Commit e9640f7

Browse files
committed
docs: add time complexity to relevant primops
1 parent 4aabdd0 commit e9640f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/libexpr/primops.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,7 +3000,7 @@ static RegisterPrimOp primop_attrNames({
30003000
alphabetically sorted list. For instance, `builtins.attrNames { y
30013001
= 1; x = "foo"; }` evaluates to `[ "x" "y" ]`.
30023002
3003-
## Time Complexity
3003+
# Time Complexity
30043004
30053005
- O(n) best case (attribute set already sorted)
30063006
- O(n log n) worst case (requires sorting), where:
@@ -3039,7 +3039,7 @@ static RegisterPrimOp primop_attrValues({
30393039
Return the values of the attributes in the set *set* in the order
30403040
corresponding to the sorted attribute names.
30413041
3042-
## Time Complexity
3042+
# Time Complexity
30433043
30443044
- O(n) best case (attribute set already sorted)
30453045
- O(n log n) worst case (requires sorting), where:
@@ -4004,7 +4004,7 @@ static RegisterPrimOp primop_any({
40044004
Return `true` if the function *pred* returns `true` for at least one
40054005
element of *list*, and `false` otherwise.
40064006
4007-
## Time Complexity
4007+
# Time Complexity
40084008
40094009
O(n * T_f) where:
40104010
@@ -4028,7 +4028,7 @@ static RegisterPrimOp primop_all({
40284028
Return `true` if the function *pred* returns `true` for all elements
40294029
of *list*, and `false` otherwise.
40304030
4031-
## Time Complexity
4031+
# Time Complexity
40324032
40334033
O(n * T_f) where:
40344034
@@ -4311,7 +4311,7 @@ static RegisterPrimOp primop_groupBy({
43114311
T_f = grouping function evaluation time
43124312
k = number of unique groups
43134313
)",
4314-
T_f = grouping function evaluation time k = number of unique groups.fun = prim_groupBy,
4314+
.fun = prim_groupBy,
43154315
});
43164316

43174317
static void prim_concatMap(EvalState & state, const PosIdx pos, Value ** args, Value & v)

0 commit comments

Comments
 (0)