From 8fcf7a265a71cf5280cc13bb0b085752f51b5fa2 Mon Sep 17 00:00:00 2001 From: Asger F Date: Wed, 13 Nov 2019 14:55:37 +0000 Subject: [PATCH] JS: Remove unused OffsetTranslationBuilder class --- .../extractor/OffsetTranslationBuilder.java | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 javascript/extractor/src/com/semmle/js/extractor/OffsetTranslationBuilder.java diff --git a/javascript/extractor/src/com/semmle/js/extractor/OffsetTranslationBuilder.java b/javascript/extractor/src/com/semmle/js/extractor/OffsetTranslationBuilder.java deleted file mode 100644 index 3f417eb7b15..00000000000 --- a/javascript/extractor/src/com/semmle/js/extractor/OffsetTranslationBuilder.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.semmle.js.extractor; - -import com.semmle.util.data.IntList; - -/** - * A mapping from integers to integers, is encoded as a sequence of consecutive intervals and their - * corresponding output intervals. - */ -public class OffsetTranslationBuilder { - private IntList anchors = IntList.create(); - private IntList deltas = IntList.create(); - - /** Returns the mapping of x. */ - public int get(int x) { - int index = anchors.binarySearch(x); - if (index < 0) { - // The insertion point is -index - 1. - // Get the index immediately before that. - index = -index - 2; - if (index < 0) { - // If queried before the first anchor, use the first anchor anyway. - index = 0; - } - } - return x + deltas.get(index); - } - - /** - * Maps the given input offset to the given output offset. - * - *

This is added as an anchor. Any offset is mapped based on its closest preceding anchor. - */ - public void set(int from, int to) { - anchors.add(from); - deltas.add(to - from); - } -}