mirror of
https://github.com/stedolan/jq.git
synced 2024-05-11 05:55:39 +00:00
limit
should use break
This commit is contained in:
@ -978,7 +978,7 @@ static const char* const jq_builtins[] = {
|
||||
" def _while: "
|
||||
" if cond then ., (update | _while) else empty end; "
|
||||
" _while;",
|
||||
"def limit(n; exp): if n < 0 then exp else foreach exp as $item ([n, null]; if .[0] < 1 then empty else [.[0] -1, $item] end; .[1]) end;",
|
||||
"def limit(n; exp): if n < 0 then exp else foreach exp as $item ([n, null]; if .[0] < 1 then break else [.[0] -1, $item] end; .[1]) end;",
|
||||
};
|
||||
#undef LIBM_DD
|
||||
|
||||
|
Reference in New Issue
Block a user