[jitsi-dev] [libjitsi] Adds support for parsing FIRs and PLIs. (43ec708)


#1

If the code doesn't make if an argument is null, then throw. If you can properly deal with it, don't. So initialize it with an empty array.
I can't conclusively say what the compiler will optimize (probably nothing), but the JIT might do it. In any case, this is such a tiny operation, it's unlikely that it's even worth thinking about it. You could even use a foreach as the index isn't needed.
My point is: after the constructor, guarantee that something is there and forget about any checks, be it null or empty. This isn't particularly about this class anyway. Just avoid null like it's the pest (especially when returning something from a method: return an empty list or array, but never null).

ยทยทยท

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/libjitsi/commit/43ec708a97ef901b3fba1681a951ce5f34b1bc26#commitcomment-16630401