Skip to content

Commit 4f636a5

Browse files
committed
Remove unnecessary conversion of arguments to json array
1 parent cd1d2db commit 4f636a5

File tree

6 files changed

+92
-91
lines changed

6 files changed

+92
-91
lines changed

include/Array1DTracer.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,57 @@ class Array1DTracer : public Tracer {
1010
}
1111

1212
Array1DTracer set(json array1d) {
13-
addTrace(key, "set", json::array({array1d}));
13+
addTrace(key, "set", {array1d});
1414
return *this;
1515
}
1616

1717
Array1DTracer set() {
18-
addTrace(key, "set", json::array({}));
18+
addTrace(key, "set", {});
1919
return *this;
2020
}
2121

2222
Array1DTracer reset() {
23-
addTrace(key, "reset", json::array({}));
23+
addTrace(key, "reset", {});
2424
return *this;
2525
}
2626

2727
Array1DTracer delay() {
28-
addTrace(key, "delay", json::array({}));
28+
addTrace(key, "delay", {});
2929
return *this;
3030
}
3131

3232
Array1DTracer patch(json x, json v) {
33-
addTrace(key, "patch", json::array({x, v}));
33+
addTrace(key, "patch", {x, v});
3434
return *this;
3535
}
3636

3737
Array1DTracer depatch(json x) {
38-
addTrace(key, "depatch", json::array({x}));
38+
addTrace(key, "depatch", {x});
3939
return *this;
4040
}
4141

4242
Array1DTracer select(json x) {
43-
addTrace(key, "select", json::array({x}));
43+
addTrace(key, "select", {x});
4444
return *this;
4545
}
4646

4747
Array1DTracer select(json sx, json ex) {
48-
addTrace(key, "select", json::array({sx, ex}));
48+
addTrace(key, "select", {sx, ex});
4949
return *this;
5050
}
5151

5252
Array1DTracer deselect(json x) {
53-
addTrace(key, "deselect", json::array({x}));
53+
addTrace(key, "deselect", {x});
5454
return *this;
5555
}
5656

5757
Array1DTracer deselect(json sx, json ex) {
58-
addTrace(key, "deselect", json::array({sx, ex}));
58+
addTrace(key, "deselect", {sx, ex});
5959
return *this;
6060
}
6161

6262
Array1DTracer chart(ChartTracer chartTracer) {
63-
addTrace(key, "chart", json::array({chartTracer.key}));
63+
addTrace(key, "chart", {chartTracer.key});
6464
return *this;
6565
}
6666
};

include/Array2DTracer.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,72 +9,72 @@ class Array2DTracer : public Tracer {
99
}
1010

1111
Array2DTracer set(json array2d) {
12-
addTrace(key, "set", json::array({array2d}));
12+
addTrace(key, "set", {array2d});
1313
return *this;
1414
}
1515

1616
Array2DTracer set() {
17-
addTrace(key, "set", json::array({}));
17+
addTrace(key, "set", {});
1818
return *this;
1919
}
2020

2121
Array2DTracer reset() {
22-
addTrace(key, "reset", json::array({}));
22+
addTrace(key, "reset", {});
2323
return *this;
2424
}
2525

2626
Array2DTracer delay() {
27-
addTrace(key, "delay", json::array({}));
27+
addTrace(key, "delay", {});
2828
return *this;
2929
}
3030

3131
Array2DTracer patch(json x, json y, json v) {
32-
addTrace(key, "patch", json::array({x, y, v}));
32+
addTrace(key, "patch", {x, y, v});
3333
return *this;
3434
}
3535

3636
Array2DTracer depatch(json x, json y) {
37-
addTrace(key, "depatch", json::array({x, y}));
37+
addTrace(key, "depatch", {x, y});
3838
return *this;
3939
}
4040

4141
Array2DTracer select(json x, json y) {
42-
addTrace(key, "select", json::array({x, y}));
42+
addTrace(key, "select", {x, y});
4343
return *this;
4444
}
4545

4646
Array2DTracer select(json sx, json sy, json ex, json ey) {
47-
addTrace(key, "select", json::array({sx, sy, ex, ey}));
47+
addTrace(key, "select", {sx, sy, ex, ey});
4848
return *this;
4949
}
5050

5151
Array2DTracer selectRow(json x, json sy, json ey) {
52-
addTrace(key, "selectRow", json::array({x, sy, ey}));
52+
addTrace(key, "selectRow", {x, sy, ey});
5353
return *this;
5454
}
5555

5656
Array2DTracer selectCol(json y, json sx, json ex) {
57-
addTrace(key, "selectCol", json::array({y, sx, ex}));
57+
addTrace(key, "selectCol", {y, sx, ex});
5858
return *this;
5959
}
6060

6161
Array2DTracer deselect(json x, json y) {
62-
addTrace(key, "deselect", json::array({x, y}));
62+
addTrace(key, "deselect", {x, y});
6363
return *this;
6464
}
6565

6666
Array2DTracer deselect(json sx, json sy, json ex, json ey) {
67-
addTrace(key, "deselect", json::array({sx, sy, ex, ey}));
67+
addTrace(key, "deselect", {sx, sy, ex, ey});
6868
return *this;
6969
}
7070

7171
Array2DTracer deselectRow(json x, json sy, json ey) {
72-
addTrace(key, "deselectRow", json::array({x, sy, ey}));
72+
addTrace(key, "deselectRow", {x, sy, ey});
7373
return *this;
7474
}
7575

7676
Array2DTracer deselectCol(json y, json sx, json ex) {
77-
addTrace(key, "deselectCol", json::array({y, sx, ex}));
77+
addTrace(key, "deselectCol", {y, sx, ex});
7878
return *this;
7979
}
8080
};

include/ChartTracer.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,57 +9,57 @@ class ChartTracer : public Tracer {
99
}
1010

1111
ChartTracer set(json array1d) {
12-
addTrace(key, "set", json::array({array1d}));
12+
addTrace(key, "set", {array1d});
1313
return *this;
1414
}
1515

1616
ChartTracer set() {
17-
addTrace(key, "set", json::array({}));
17+
addTrace(key, "set", {});
1818
return *this;
1919
}
2020

2121
ChartTracer reset() {
22-
addTrace(key, "reset", json::array({}));
22+
addTrace(key, "reset", {});
2323
return *this;
2424
}
2525

2626
ChartTracer delay() {
27-
addTrace(key, "delay", json::array({}));
27+
addTrace(key, "delay", {});
2828
return *this;
2929
}
3030

3131
ChartTracer patch(json x, json v) {
32-
addTrace(key, "patch", json::array({x, v}));
32+
addTrace(key, "patch", {x, v});
3333
return *this;
3434
}
3535

3636
ChartTracer depatch(json x) {
37-
addTrace(key, "depatch", json::array({x}));
37+
addTrace(key, "depatch", {x});
3838
return *this;
3939
}
4040

4141
ChartTracer select(json x) {
42-
addTrace(key, "select", json::array({x}));
42+
addTrace(key, "select", {x});
4343
return *this;
4444
}
4545

4646
ChartTracer select(json sx, json ex) {
47-
addTrace(key, "select", json::array({sx, ex}));
47+
addTrace(key, "select", {sx, ex});
4848
return *this;
4949
}
5050

5151
ChartTracer deselect(json x) {
52-
addTrace(key, "deselect", json::array({x}));
52+
addTrace(key, "deselect", {x});
5353
return *this;
5454
}
5555

5656
ChartTracer deselect(json sx, json ex) {
57-
addTrace(key, "deselect", json::array({sx, ex}));
57+
addTrace(key, "deselect", {sx, ex});
5858
return *this;
5959
}
6060

6161
ChartTracer chart(ChartTracer chartTracer) {
62-
addTrace(key, "chart", json::array({chartTracer.key}));
62+
addTrace(key, "chart", {chartTracer.key});
6363
return *this;
6464
}
6565
};

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy