Skip to content

Commit 8683365

Browse files
committed
Simplify is op for cloning check
1 parent e2dfda2 commit 8683365

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pbm/oplog/restore.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,16 +389,15 @@ func (o *OplogRestore) isOpForCloning(oe *db.Oplog) bool {
389389
return true // internal ops of applyOps are checked one by one later
390390
}
391391

392-
cloneFromDB, cloneFromColl, _ := strings.Cut(o.cloneNS.FromNS, ".")
393-
if db != cloneFromDB {
392+
if db != o.cloneNS.fromDB {
394393
// it's command not relevant for db to clone from
395394
return false
396395
}
397396

398397
if _, ok := cloningNSSupportedCommands[cmd]; ok {
399398
// check if command targets collection
400399
collForCmd, _ := oe.Object[0].Value.(string)
401-
if collForCmd == cloneFromColl {
400+
if collForCmd == o.cloneNS.fromColl {
402401
return true
403402
}
404403
}

0 commit comments

Comments
 (0)