Skip to content

Commit

Permalink
Add Map types in LogEntryCharMaps
Browse files Browse the repository at this point in the history
  • Loading branch information
LightFLP committed Sep 27, 2023
1 parent 9dcf62b commit 789ecd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/viewer/hooks/useStructureRegularExpressionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,10 @@ export const useStructureRegularExpressionSearch = (
const indexOfFirstObjectInMatch = logEntryCharIndexMaps.firstCharIndexMap.get(matchRanges[0]);
const indexOfLastObjectInMatch = logEntryCharIndexMaps.lastCharIndexMap.get(matchRanges[1]);

for (let i = indexOfFirstObjectInMatch; i <= indexOfLastObjectInMatch; i++) {
indexesOfEntriesInMatch.push(i);
if(indexOfFirstObjectInMatch && indexOfLastObjectInMatch) {
for (let i = indexOfFirstObjectInMatch; i <= indexOfLastObjectInMatch; i++) {
indexesOfEntriesInMatch.push(i);
}
}

resultingMatches.push(indexesOfEntriesInMatch);
Expand Down
4 changes: 2 additions & 2 deletions src/viewer/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ export interface Segment {
}

export interface LogEntryCharMaps {
firstCharIndexMap;
lastCharIndexMap;
firstCharIndexMap: Map<number, number>;
lastCharIndexMap: Map<number, number>;
}

0 comments on commit 789ecd5

Please sign in to comment.