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
..
2019-03-19 12:00:29 +01:00
2018-10-10 19:03:56 +03:00
2019-03-12 09:33:00 +01:00
2018-12-21 16:09:04 +01:00
2019-01-24 16:14:40 +03:00
2019-02-19 09:59:42 +03:00
2019-02-25 15:09:26 +03:00
2019-01-24 16:14:40 +03:00
2019-03-19 12:00:29 +01:00
2019-03-19 12:00:29 +01:00
2019-01-24 16:14:40 +03:00
2019-03-19 09:20:41 +01:00
2018-12-21 16:09:04 +01:00
2019-03-19 12:00:29 +01:00
2019-02-19 16:37:47 +01:00
2019-01-24 16:14:40 +03:00
2018-12-20 12:53:23 +01:00
2018-10-25 15:48:42 +03:00
2018-08-09 14:22:46 +03:00
2018-12-28 15:09:11 +03:00
2019-03-19 12:00:29 +01:00
2019-03-18 14:04:02 +03:00
2019-03-13 10:01:21 +01:00
2019-01-23 15:11:14 +01:00
2019-01-31 18:19:41 +03:00
2019-03-19 12:00:29 +01:00
2018-12-21 16:09:04 +01:00
2019-01-24 16:14:40 +03:00
2019-02-07 16:05:16 +01:00
2018-10-15 00:03:45 +03:00
2019-03-19 12:00:29 +01:00
2019-01-24 16:14:40 +03:00
2018-07-10 13:34:19 +03:00
2019-01-24 16:14:40 +03:00
2018-12-21 16:09:06 +01:00
2018-12-21 16:09:07 +01:00
2019-03-19 12:00:29 +01:00
2019-01-23 15:11:14 +01:00
2019-01-26 08:26:49 +01:00
2018-12-21 16:09:12 +01:00
2018-12-21 16:09:09 +01:00
2019-03-04 23:24:18 +03:00
2019-02-19 09:59:42 +03:00
2019-03-11 19:14:29 +03:00
2019-02-19 09:59:42 +03:00
2019-03-19 09:20:41 +01:00
2018-07-10 13:34:19 +03:00
2019-03-19 12:00:29 +01:00
2019-02-15 16:25:16 +03:00
2019-01-29 17:24:49 +03:00
2019-01-24 16:14:40 +03:00
2019-03-19 12:00:29 +01:00
2019-03-19 12:00:29 +01:00
2019-03-19 12:00:29 +01:00
2019-01-26 08:26:49 +01:00
2019-03-06 15:34:23 +01:00
2019-01-03 07:57:36 +01:00
2018-08-09 14:22:50 +03:00
2018-09-18 14:36:20 +03:00
2019-03-19 09:20:41 +01:00
2019-01-31 15:47:43 +01:00
2019-01-24 16:14:40 +03:00
2019-03-19 12:00:29 +01:00
2019-03-14 14:59:34 +01:00
2019-01-24 16:14:40 +03:00
2019-01-19 09:43:43 +01:00
2019-01-29 19:06:31 +03:00
2019-01-26 08:26:49 +01:00
2019-01-27 01:14:51 +03:00
2019-01-24 16:14:40 +03:00
2019-01-24 16:14:40 +03:00
2018-10-22 16:32:55 +02:00
2019-01-24 16:14:40 +03:00
2018-11-23 18:41:33 +01:00
2019-01-24 16:14:40 +03:00
2018-12-21 16:09:04 +01:00
2019-03-19 12:00:29 +01:00
2018-12-21 16:09:04 +01:00
2019-01-29 19:06:31 +03:00
2019-03-19 12:00:29 +01:00
2019-03-19 12:00:29 +01:00
2019-03-19 12:00:29 +01:00
2019-01-24 23:05:56 +03:00
2019-01-26 08:26:49 +01:00
2018-06-14 19:54:30 +03:00
2019-03-19 09:20:41 +01:00
2018-06-28 12:26:41 +02:00
2018-08-02 15:51:16 +02:00
2018-10-22 16:32:55 +02:00
2019-02-23 00:42:16 +03:00
2018-12-21 16:09:06 +01:00
2018-08-09 20:55:50 +03:00
2019-02-27 08:36:35 +01:00
2019-02-07 21:25:59 +01:00
2018-12-21 16:09:10 +01:00
2018-12-21 16:09:07 +01:00
2019-01-24 16:14:40 +03:00
2018-12-21 16:09:07 +01:00
2019-01-26 08:26:49 +01:00
2019-03-19 09:20:41 +01:00
2018-12-21 16:09:06 +01:00
2019-03-19 12:00:29 +01:00
2018-10-10 17:27:37 +03:00
2018-08-15 10:26:28 +03:00
2019-01-27 01:14:51 +03:00
2019-02-19 16:37:47 +01:00
2019-03-20 09:13:51 +01:00