Advertisement
rotrevrep

add_array bugfix \o/

Aug 1st, 2013
282
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.82 KB | None | 0 0
  1.         public void add_array(T[] table){
  2.             if(typeof(T) == typeof(bool)){ foreach(bool b in (bool[])table)add(b); }
  3.             else if(typeof(T) == typeof(char)){ foreach(char c in (char[])table)add(c); }
  4.             else if(typeof(T) == typeof(uchar)){ foreach(uchar u in (uchar[])table)add(u); }
  5.             else if(typeof(T) == typeof(int)){ foreach(int i in (int[])table)add(i); }
  6.             else if(typeof(T) == typeof(uint)){ foreach(uint u in (uint[])table)add(u); }
  7.             else if(typeof(T) == typeof(int64)){ foreach(int64 i in (int64[])table)add(i); }
  8.             else if(typeof(T) == typeof(uint64)){ foreach(uint64 u in (uint64[])table)add(u); }
  9.             else if(typeof(T) == typeof(long)){ foreach(long l in (long[])table)add(l); }
  10.             else if(typeof(T) == typeof(ulong)){ foreach(ulong u in (ulong[])table)add(u); }
  11.             else { foreach(var item in table)add(item); }
  12.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement