Merge pull request #21775 from MrStonedOne/patch-263

Faster listclearnulls()
This commit is contained in:
oranges
2016-11-28 10:04:20 +13:00
committed by GitHub
+3 -8
View File
@@ -104,13 +104,8 @@
//Removes any null entries from the list
/proc/listclearnulls(list/L)
if(istype(L))
var/i=1
for(var/thing in L)
if(thing != null)
++i
continue
L.Cut(i,i+1)
var/list/N = new(L.len)
L -= N
/*
* Returns list containing all the entries from first list that are not present in second.
@@ -412,4 +407,4 @@
#define UNSETEMPTY(L) if (L && !L.len) L = null
#define LAZYLEN(L) ( L ? L.len : 0 )
#define LAZYLEN(L) ( L ? L.len : 0 )