Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c9ac6ee

Browse files
committed
[cpp.run] fixes replace bug
Signed-off-by: Eric Wang <skygragon@gmail.com>
1 parent 887996a commit c9ac6ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cpp.run.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ plugin.testProblem = function(problem, cb) {
4444
// array, list, tree, etc
4545
var t = meta.params[i].type;
4646
if (t.indexOf('[]') >= 0 || t === 'ListNode' || t === 'TreeNode')
47-
x = x.replace('[', '{').replace(']', '}');
47+
x = x.replace(/\[/g, '{').replace(/\]/g, '}');
4848
if (t === 'ListNode') x = 'make_listnode(' + x + ')';
4949
if (t === 'TreeNode') x = 'make_treenode(' + x + ')';
5050

0 commit comments

Comments
 (0)