Just out of curiosity, why this range check: ```if...
# javascript
e
Just out of curiosity, why this range check:
Copy code
if (index !in 0..<size) {
  return IntStream.EOF
}
Is compiled down to:
Copy code
if (!(0 <= index ? index < $this.size_1 : false)) {
  return Companion_getInstance_6().get_EOF_18juz1_k$();
}
That's a very atypical way of performing a check like that. When I switch to a "manual" range check:
Copy code
if (index < 0 || index >= size) {
  return IntStream.EOF
}
the output gets a little bit better:
Copy code
if (index < 0 ? true : index >= $this.size_1) {
  return Companion_getInstance_6().get_EOF_18juz1_k$();
}
a
I need to discuss it with the team. I don't know why it's compiled in such a weird way, definitely, it could be compiled mostly one-to-one
e
Thank you! That was just an observation, as I was trying to replace the range checks with
in
or
!in
expressions, which are more readable.
Let me know if you prefer an issue logged btw. So we can keep track of it.
a
It would be great to have it