Skip to content

Commit

Permalink
Optimize by moving constant values into global init
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: fisehara <harald@balena.io>
  • Loading branch information
fisehara committed Jan 4, 2024
1 parent 3c6c2d5 commit 94899b7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions odata-parser.pegjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{{
const methods = {
cast: [ 1, 2 ],
ceiling: 1,
Expand Down Expand Up @@ -66,20 +66,21 @@
// mod: 5
// };

let binds = [];
let precedence = 0;
function reset() {
binds = [];
precedence = 0;
};

function CollapseObjectArray(options) {
const optionsObj = {};
for(const i in options) {
optionsObj[options[i].name] = options[i].value;
}
return optionsObj;
};
}}
{
let binds = [];
let precedence = 0;
function reset() {
binds = [];
precedence = 0;
};

function Bind(type, value) {
binds.push([type, value])
Expand Down

0 comments on commit 94899b7

Please sign in to comment.