MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / numberCompilersIfNeeded

Method numberCompilersIfNeeded

lib/clientstate.ts:401–421  ·  view source on GitHub ↗
(session: ClientStateSession, startAt?: number)

Source from the content-addressed store, hash-verified

399 }
400
401 numberCompilersIfNeeded(session: ClientStateSession, startAt?: number) {
402 let id = startAt;
403 let someIdsNeedNumbering = false;
404
405 for (const compiler of session.compilers) {
406 if (compiler._internalid && id && compiler._internalid >= id) {
407 id = compiler._internalid + 1;
408 } else {
409 someIdsNeedNumbering = true;
410 }
411 }
412
413 if (someIdsNeedNumbering) {
414 for (const compiler of session.compilers) {
415 if (!compiler._internalid) {
416 compiler._internalid = id;
417 if (id) id++;
418 }
419 }
420 }
421 }
422
423 findSessionById(id: number) {
424 for (const session of this.sessions) {

Callers 2

fromJsonDataMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected