From: Mario Date: Fri, 21 Oct 2016 01:17:03 +0000 (+0000) Subject: Merge branch 'martin-t/unused_fields' into 'master' X-Git-Tag: xonotic-v0.8.2~488 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=432126e0c7bf5c11c11d9d6db7b311b0ad64c585;p=xonotic%2Fxonotic-data.pk3dir.git Merge branch 'martin-t/unused_fields' into 'master' Martin t/unused fields I was playing with grep&friends and decided to see if I could remove some unused fields from the code. I actually expected to find a lot more and only removed a few of those anyway because sometimes I wasn't sure if it's safe to remove them and didn't wanna spend too much time on it. If anybody wants to go more in-depth, I'll leave the ipython script here as inspiration ``` #!/usr/bin/env ipython3 fields = !find . -type f -name '*.q*' -print0 | xargs -0 grep -hoP '^[[:space:]]*\.[a-zA-Z1-9_]+ [a-zA-Z1-9_]+(, [a-zA-Z1-9_]+)*;' | awk '{$1 = ""; print}' | tr ',' '\n' | tr -d " ;" fields = set(fields) fields = sorted(fields) for field in fields: ret = !find . -type f -name '*.q*' -print0 | xargs -0 grep -P '\.$field[^a-zA-Z1-9_]?' if len(ret) <= 1: print(field + " " + str(len(ret))) ``` See merge request !378 --- 432126e0c7bf5c11c11d9d6db7b311b0ad64c585