Skip to content

Commit

Permalink
Merge pull request #78 from balena-io-modules/fisehara/optimize-using…
Browse files Browse the repository at this point in the history
…-global-initialization

Optimize by moving constant values into global init
  • Loading branch information
flowzone-app[bot] committed Jan 4, 2024
2 parents 3c6c2d5 + 94899b7 commit eb47abf
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 eb47abf

Please sign in to comment.