Ting-Yuan Huang
f6cf434650
when: emit switch for String if possible
...
Effectively, the following when structure:
when (s) {
s1, s2 -> e1,
s3 -> e2,
s4 -> e3,
...
else -> e
}
is implemented as:
when (s.hashCode()) {
h1 -> {
if (s == s1)
e1
else if (s == s2)
e1
else if (s == s3)
e2
else
e
}
h2 -> if (s == s3) e2 else e,
...
else -> e
}
where s1.hashCode() == s2.hashCode() == s3.hashCode() == h1,
s4.hashCode() == h2.
A tableswitch or lookupswitch is used for the hash code lookup.
Change-Id: I087bf623dbb4a41d3cc64399a1b42342a50757a6
2019-03-20 09:13:51 +01:00
..
2018-12-21 16:20:45 +01:00
2019-02-18 12:39:03 +03:00
2018-12-21 16:20:45 +01:00
2019-02-01 21:45:44 +03:00
2019-02-23 00:42:16 +03:00
2018-12-21 16:20:45 +01:00
2019-02-01 17:33:49 +03:00
2018-12-21 16:20:45 +01:00
2018-12-28 14:18:39 +03:00
2019-02-07 23:32:32 +01:00
2019-03-15 08:32:22 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2019-03-13 08:48:20 +01:00
2019-02-19 18:09:23 +03:00
2019-01-23 15:11:14 +01:00
2018-12-28 14:18:39 +03:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2019-01-23 15:11:14 +01:00
2019-02-01 17:33:49 +03:00
2017-06-28 13:44:07 +02:00
2019-01-19 09:43:43 +01:00
2019-02-01 17:33:49 +03:00
2018-12-21 16:20:45 +01:00
2019-02-23 00:42:16 +03:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-28 14:18:39 +03:00
2018-12-21 16:20:45 +01:00
2019-02-19 15:46:52 +01:00
2019-03-13 08:48:20 +01:00
2019-02-01 21:45:44 +03:00
2019-02-19 16:37:47 +01:00
2019-01-25 15:57:13 +01:00
2019-02-19 15:46:52 +01:00
2018-12-21 16:20:45 +01:00
2019-01-10 17:17:51 +03:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-28 14:18:39 +03:00
2019-02-27 08:36:35 +01:00
2019-01-17 13:49:39 +03:00
2018-12-21 16:20:45 +01:00
2019-03-20 09:13:51 +01:00
2018-12-21 16:20:45 +01:00
2019-03-20 09:13:51 +01:00
2018-12-21 16:20:45 +01:00
2017-03-10 10:04:30 +01:00
2019-02-23 00:42:16 +03:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2017-07-27 09:02:26 +03:00
2017-06-20 13:31:36 +03:00
2018-05-21 20:43:37 +03:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2019-01-19 09:43:43 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-20 12:53:24 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2017-09-06 08:20:32 +02:00
2018-12-21 16:20:45 +01:00
2017-01-13 10:31:07 +03:00
2018-06-22 16:53:07 +03:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2019-02-07 23:32:32 +01:00
2019-02-07 23:32:32 +01:00
2019-02-05 08:44:33 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00
2018-12-21 16:20:45 +01:00