mirror of
https://github.com/okhsunrog/vpnhide.git
synced 2026-04-28 06:31:27 +00:00
refactor(lsposed): mStackedLinks rewrite only on actual changes
The else-branch in sanitizeLinkProperties' stacked-links loop set `modified = true` whenever `stackedCopy !== value`, i.e. after any successful clone. Cloning is the common case (the catch fallback is just a defensive shim for a missing copy ctor), so the flag was effectively always-true: every non-empty stacked map triggered the trailing `stacked.clear() + putAll(filtered)`, even when no VPN data was present and no modification happened. Drop the `stackedCopy !== value` disjunct. `modified` now reflects only real sanitization changes — the rewrite is skipped when there's nothing to write back, and the clones in `filtered` are discarded along with the never-mutated original entries staying in place. No behavioural change for VPN-stripping callers; just less wasted work on the non-VPN-bearing path.
This commit is contained in:
parent
b9eacc63bc
commit
d7ef5c7b8f
1 changed files with 7 additions and 1 deletions
|
|
@ -125,7 +125,13 @@ class HookEntry : IXposedHookLoadPackage {
|
|||
filtered[key] = stackedCopy
|
||||
}
|
||||
} else {
|
||||
if (stackedModified || stackedCopy !== value) modified = true
|
||||
// Only mark `modified` if sanitization actually
|
||||
// changed something. The previous condition also
|
||||
// tripped on `stackedCopy !== value`, which is
|
||||
// true after every successful clone — so any
|
||||
// non-empty stacked map forced a clear+putAll
|
||||
// even when no VPN data was present.
|
||||
if (stackedModified) modified = true
|
||||
filtered[key] = stackedCopy
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue