Kaydet (Commit) 80a90a63 authored tarafından Gabor Kelemen's avatar Gabor Kelemen Kaydeden (comit) Miklos Vajna

find-unneeded-includes: use a better data structure

Turns out plain dictionary requires keys to be unique.
So we need to store values as lists.

This way there are no more false positives for <set> as in
include/sfx2/linkmgr.hxx and include/sfx2/objsh.hxx

Thanks Miklos for the advice!

Change-Id: Ie2cfb63644d6cbd51171eb95e3bcdd9246343efa
Reviewed-on: https://gerrit.libreoffice.org/69953
Tested-by: Jenkins
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
üst d81070ce
...@@ -40,19 +40,20 @@ def ignoreRemoval(include, toAdd, absFileName, moduleRules): ...@@ -40,19 +40,20 @@ def ignoreRemoval(include, toAdd, absFileName, moduleRules):
# Avoid debug STL. # Avoid debug STL.
debugStl = { debugStl = {
"array": "debug/array", "array": ("debug/array"),
"bitset": "debug/bitset", "bitset": ("debug/bitset"),
"deque": "debug/deque", "deque": ("debug/deque"),
"list": "debug/list", "list": ("debug/list"),
"map": "debug/map.h", "map": ("debug/map.h"),
"set": "debug/set.h", "set": ("debug/set.h", "debug/multiset.h"),
"set": "debug/multiset.h", "unordered_map": ("debug/unordered_map"),
"unordered_map": "debug/unordered_map", "unordered_set": ("debug/unordered_set"),
"unordered_set": "debug/unordered_set", "vector": ("debug/vector"),
"vector": "debug/vector",
} }
for k, v in debugStl.items(): for k, values in debugStl.items():
if include == k and v in toAdd: if include == k:
for value in values:
if value in toAdd:
return True return True
# Avoid proposing to use libstdc++ internal headers. # Avoid proposing to use libstdc++ internal headers.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment