Skip to content

Commit d897244

Browse files
committed
Do not assume that std.reverse accepts a string, this is not true for the Go builtin implementation
1 parent e76d627 commit d897244

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/std.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ limitations under the License.
140140
if maxsplits == -1 then
141141
std.splitLimit(str, c, -1)
142142
else
143-
local revStr(str) = std.join('', std.reverse(str));
143+
local revStr(str) = std.join('', std.reverse(std.stringChars(str)));
144144
std.map(function(e) revStr(e), std.reverse(std.splitLimit(revStr(str), revStr(c), maxsplits))),
145145

146146
strReplace(str, from, to)::

0 commit comments

Comments
 (0)