Replace SparseArray<T> with T[]

This commit is contained in:
Andy Hanson
2016-12-28 09:39:58 -08:00
parent 346a86582b
commit 2e6f369e8f
12 changed files with 23 additions and 30 deletions

View File

@@ -16,7 +16,7 @@ namespace ts {
}
export namespace codefix {
const codeFixes: SparseArray<CodeFix[]> = [];
const codeFixes: CodeFix[][] = [];
export function registerCodeFix(action: CodeFix) {
forEach(action.errorCodes, error => {

View File

@@ -14,7 +14,7 @@ namespace ts.codefix {
}
class ImportCodeActionMap {
private symbolIdToActionMap: SparseArray<ImportCodeAction[]> = [];
private symbolIdToActionMap: ImportCodeAction[][] = [];
addAction(symbolId: number, newAction: ImportCodeAction) {
if (!newAction) {
@@ -125,7 +125,7 @@ namespace ts.codefix {
const symbolIdActionMap = new ImportCodeActionMap();
// this is a module id -> module import declaration map
const cachedImportDeclarations: SparseArray<(ImportDeclaration | ImportEqualsDeclaration)[]> = [];
const cachedImportDeclarations: (ImportDeclaration | ImportEqualsDeclaration)[][] = [];
let cachedNewImportInsertPosition: number;
const allPotentialModules = checker.getAmbientModules();