!58 【轻量级 PR】:修改语义不清晰的变量名

Merge pull request !58 from Catchiz/N/A
This commit is contained in:
openInula-robot 2023-10-27 07:41:52 +00:00 committed by Gitee
commit dffc6cfe0e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 3 additions and 3 deletions

View File

@ -109,12 +109,12 @@ export function stripBasename(path: string, prefix: string): string {
export function createMemoryRecord<T, S>(initVal: S, fn: (arg: S) => T) {
let visitedRecord: T[] = [fn(initVal)];
function getDelta(to: S, form: S): number {
let toIdx = visitedRecord.lastIndexOf(fn(to));
function getDelta(toKey: S, fromKey: S): number {
let toIdx = visitedRecord.lastIndexOf(fn(toKey));
if (toIdx === -1) {
toIdx = 0;
}
let fromIdx = visitedRecord.lastIndexOf(fn(form));
let fromIdx = visitedRecord.lastIndexOf(fn(fromKey));
if (fromIdx === -1) {
fromIdx = 0;
}