Remove createUnderscoreEscapedMultiMap (#53029)

This commit is contained in:
Jake Bailey 2023-02-28 13:21:20 -08:00 committed by GitHub
parent 74814345ce
commit a0374077dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 23 deletions

View File

@ -110,6 +110,7 @@ import {
createGetCanonicalFileName,
createGetSymbolWalker,
createModeAwareCacheKey,
createMultiMap,
createPrinterWithDefaults,
createPrinterWithRemoveComments,
createPrinterWithRemoveCommentsNeverAsciiEscape,
@ -117,7 +118,6 @@ import {
createPropertyNameNodeForIdentifierOrLiteral,
createSymbolTable,
createTextWriter,
createUnderscoreEscapedMultiMap,
Debug,
Declaration,
DeclarationName,
@ -7187,7 +7187,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
}
const mayHaveNameCollisions = !(context.flags & NodeBuilderFlags.UseFullyQualifiedType);
/** Map from type reference identifier text to [type, index in `result` where the type node is] */
const seenNames = mayHaveNameCollisions ? createUnderscoreEscapedMultiMap<[Type, number]>() : undefined;
const seenNames = mayHaveNameCollisions ? createMultiMap<__String, [Type, number]>() : undefined;
const result: TypeNode[] = [];
let i = 0;
for (const type of types) {

View File

@ -12,7 +12,6 @@ import {
SortedArray,
SortedReadonlyArray,
TextSpan,
UnderscoreEscapedMap,
} from "./_namespaces/ts";
@ -1657,26 +1656,6 @@ function multiMapRemove<K, V>(this: MultiMap<K, V>, key: K, value: V) {
}
}
/** @internal */
export interface UnderscoreEscapedMultiMap<T> extends UnderscoreEscapedMap<T[]> {
/**
* Adds the value to an array of values associated with the key, and returns the array.
* Creates the array if it does not already exist.
*/
add(key: __String, value: T): T[];
/**
* Removes a value from an array of values associated with the key.
* Does not preserve the order of those values.
* Does nothing if `key` is not in `map`, or `value` is not in `map[key]`.
*/
remove(key: __String, value: T): void;
}
/** @internal */
export function createUnderscoreEscapedMultiMap<T>(): UnderscoreEscapedMultiMap<T> {
return createMultiMap() as UnderscoreEscapedMultiMap<T>;
}
/** @internal */
export function createQueue<T>(items?: readonly T[]): Queue<T> {
const elements: (T | undefined)[] = items?.slice() || [];