gregorbg
01/19/2020, 9:31 AMfun <T> List<T>.headWithTail() = firstOrNull() to drop(1)
Obviously the function still needs a better name, but I find myself using this concept rather often when recursively processing list entries or working with data that is presented as a "heading + contents" table.
val (heading, contents) = parsedCsv.headWithTail()
jw
01/19/2020, 2:14 PMelizarov
01/20/2020, 7:23 AMstantronic
01/21/2020, 3:28 PMjimn
01/27/2020, 2:13 AMelizarov
01/27/2020, 12:21 PMjimn
01/27/2020, 12:26 PMjimn
01/27/2020, 12:33 PMelizarov
01/27/2020, 12:36 PMelizarov
01/27/2020, 12:38 PMLinkedList
with ArrayList
, you’ll get an overall speed boost and lower memory consumption. The very act of adding LinkedList
to Java standard library was a mistake.jimn
01/27/2020, 12:45 PMjimn
01/27/2020, 12:46 PMjimn
01/27/2020, 12:49 PM