optimize: remove useless code

This commit is contained in:
zhoulixiang
2024-04-15 14:49:38 +08:00
parent d1f7f60544
commit 8a3cfebdc7
3 changed files with 3 additions and 3 deletions

View File

@@ -96,7 +96,7 @@ export class AC {
while (queue.length > queueIndex) { while (queue.length > queueIndex) {
let node = queue[queueIndex++] as TrieNode; let node = queue[queueIndex++] as TrieNode;
let failNode = node && node.parent && node.parent.fail as TrieNode | null; let failNode = node.parent && node.parent.fail as TrieNode | null;
let key = node.key; let key = node.key;
while (failNode && !failNode.children.has(key)) { while (failNode && !failNode.children.has(key)) {

View File

@@ -1,4 +1,4 @@
import { DoubleUnicodePrefixReg, DoubleUnicodeSuffixReg, DoubleUnicodeReg } from './constant'; import { DoubleUnicodeReg } from './constant';
export function getStringLength(string: string) { export function getStringLength(string: string) {
return string.replace(DoubleUnicodeReg, '_').length; return string.replace(DoubleUnicodeReg, '_').length;

View File

@@ -1,4 +1,4 @@
import { configDefaults, defineConfig } from 'vitest/config'; import { defineConfig } from 'vitest/config';
import path from 'path'; import path from 'path';
export default defineConfig({ export default defineConfig({