]> git.cworth.org Git - empires-server/commit
Use spread syntax rather than fill(nill) in generate_id
authorCarl Worth <cworth@cworth.org>
Wed, 10 Jun 2020 01:14:29 +0000 (18:14 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 10 Jun 2020 01:14:29 +0000 (18:14 -0700)
commit1010e7bfe722481b7036934b6b859b8bb7916d52
tree103091cfeb0ad620256f0f8d1e830c0f400a71b0
parentc415c76ac632b8e55cf0260c52ebc7c77836614e
Use spread syntax rather than fill(nill) in generate_id

We don't actually need the array filled with null values specifically,
we just need something that map() will act on (since it doesn't act on
the empty entries we get from Array(4)). Using [...Array(4)] gives us
an array of undefined values which does the trick, and is a bit more
compact than .fill(null).

Of course, I blow away any savings in compactness with the giant
comment I've added here!
lmno.js