mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Drop dead exact-match check in vlan delete filter
A bare "vlan N" line never matches conf_cmds (a VLAN entry always carries a member port or the mgmt/name keyword), so it is never stored. The c !== "vlan N" comparison could therefore never match an entry; the startsWith(prefix) check alone covers all stored vlan lines.
This commit is contained in:
+1
-2
@@ -59,8 +59,7 @@ function parseConf(s){
|
|||||||
const deleteMatch = line.match(/^vlan\s+(\d{1,4})\s+d$/);
|
const deleteMatch = line.match(/^vlan\s+(\d{1,4})\s+d$/);
|
||||||
if (deleteMatch) {
|
if (deleteMatch) {
|
||||||
const prefix = "vlan " + deleteMatch[1] + " ";
|
const prefix = "vlan " + deleteMatch[1] + " ";
|
||||||
configuration = configuration.filter(c =>
|
configuration = configuration.filter(c => !c.startsWith(prefix));
|
||||||
c !== "vlan " + deleteMatch[1] && !c.startsWith(prefix));
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
console.log(l + ' --> ' + line);
|
console.log(l + ' --> ' + line);
|
||||||
|
|||||||
Reference in New Issue
Block a user