minor optimization
This commit is contained in:
@@ -61,10 +61,15 @@ func (mc *MetaCache) AtomicUpdateEntry(ctx context.Context, oldPath util.FullPat
|
|||||||
oldDir, _ := oldPath.DirAndName()
|
oldDir, _ := oldPath.DirAndName()
|
||||||
if mc.visitedBoundary.HasVisited(util.FullPath(oldDir)) {
|
if mc.visitedBoundary.HasVisited(util.FullPath(oldDir)) {
|
||||||
if oldPath != "" {
|
if oldPath != "" {
|
||||||
|
if oldPath == newEntry.FullPath {
|
||||||
|
// skip the unnecessary deletion
|
||||||
|
// leave the update to the following InsertEntry operation
|
||||||
|
} else {
|
||||||
if err := mc.actualStore.DeleteEntry(ctx, oldPath); err != nil {
|
if err := mc.actualStore.DeleteEntry(ctx, oldPath); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// println("unknown old directory:", oldDir)
|
// println("unknown old directory:", oldDir)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user