From 4249bbf0d549c6c2e9e1e1e93ccda7f87523cf05 Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Fri, 8 Aug 2014 19:36:43 -0500 Subject: [PATCH] Make `nwise` private --- builtin.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builtin.c b/builtin.c index fdf947a0..79f89af0 100644 --- a/builtin.c +++ b/builtin.c @@ -998,15 +998,15 @@ static const char* const jq_builtins[] = { // // If input is an array, then emit a stream of successive subarrays of length n (or less), // and similarly for strings. - "def nwise(a; $n): if a|length <= $n then a else a[0:$n] , nwise(a[$n:]; $n) end;", - "def nwise($n): nwise(.; $n);", + "def _nwise(a; $n): if a|length <= $n then a else a[0:$n] , _nwise(a[$n:]; $n) end;", + "def _nwise($n): _nwise(.; $n);", // // splits/1 produces a stream; split/1 is retained for backward compatibility. "def splits($re; flags): . as $s" // # multiple occurrences of "g" are acceptable " | [ match($re; \"g\" + flags) | (.offset, .offset + .length) ]" " | [0] + . +[$s|length]" - " | nwise(2)" + " | _nwise(2)" " | $s[.[0]:.[1] ] ;", "def splits($re): splits($re; null);", //