MCPcopy
hub / github.com/witheve/Eve / blocksFromCommit

Method blocksFromCommit

src/runtime/runtime.ts:146–178  ·  view source on GitHub ↗
(commit)

Source from the content-addressed store, hash-verified

144 }
145
146 blocksFromCommit(commit) {
147 let perf = this.perf;
148 let start = perf.time();
149 let blocks = [];
150 let index = this.multiIndex;
151 let tagsCache = {};
152 for(let database of this.databases) {
153 if(database.nonExecuting) continue;
154 for(let block of database.blocks) {
155 if(block.dormant) continue;
156 let checker = block.checker;
157 for(let ix = 0, len = commit.length; ix < len; ix += 6) {
158 let change = commit[ix];
159 let e = commit[ix + 1];
160 let a = commit[ix + 2];
161 let v = commit[ix + 3];
162
163 let tags = tagsCache[e];
164 if(tags === undefined) {
165 tags = tagsCache[e] = index.dangerousMergeLookup(e,"tag",undefined);
166 }
167
168 if(checker.check(index, change, tags, e, a, v)) {
169 blocks.push(block);
170 break;
171 }
172 }
173 }
174 }
175 perf.blockCheck(start);
176 // console.log("executing blocks", blocks.map((x) => x));
177 return blocks;
178 }
179
180
181 getAllBlocks() {

Callers 3

queueMethod · 0.95
executeActionsMethod · 0.95
fixpointMethod · 0.95

Calls 3

dangerousMergeLookupMethod · 0.80
checkMethod · 0.80
blockCheckMethod · 0.45

Tested by

no test coverage detected