Ondřej Surý
358affe585
Use switch instead of if when evaluating curves
...
Previously, the code would do:
REQUIRE(alg == CURVE1 || alg == CURVE2);
[...]
if (alg == CURVE1) { /* code for CURVE1 */ }
else { /* code for CURVE2 */ }
This approach is less extensible and also more prone to errors in case
the initial REQUIRE() is forgotten. The code has been refactored to
use:
REQUIRE(alg == CURVE1 || alg == CURVE2);
[...]
switch (alg) {
case CURVE1: /* code for CURVE1 */; break;
case CURVE2: /* code for CURVE2 */; break;
default: INSIST(0);
}
(cherry picked from commit cf30e7d0d1 )
2020-05-01 06:54:27 +02:00
..
2020-04-03 10:04:07 +02:00
2020-03-17 15:33:23 -07:00
2020-03-18 11:44:18 +01:00
2020-04-16 07:56:38 +02:00
2020-02-14 05:35:29 +00:00
2020-04-16 07:56:37 +02:00
2020-04-16 23:07:40 +02:00
2020-03-04 10:48:59 +01:00
2020-02-14 05:35:29 +00:00
2020-02-14 08:45:59 +00:00
2020-02-14 08:45:59 +00:00
2020-02-21 07:05:31 +00:00
2020-03-18 11:44:18 +01:00
2020-02-14 05:35:29 +00:00
2020-02-27 08:54:02 +01:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-03-11 08:55:12 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-21 07:05:31 +00:00
2020-03-11 08:55:12 +00:00
2020-03-11 08:55:12 +00:00
2020-02-21 07:05:31 +00:00
2020-04-28 15:24:07 +02:00
2020-05-01 06:54:26 +02:00
2020-05-01 06:54:26 +02:00
2020-03-11 08:55:12 +00:00
2020-03-11 08:55:12 +00:00
2020-02-14 08:45:59 +00:00
2020-02-12 14:51:18 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 08:45:59 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 08:45:59 +00:00
2020-03-11 08:55:12 +00:00
2020-03-17 15:33:24 -07:00
2020-03-17 15:33:24 -07:00
2020-02-14 05:35:29 +00:00
2020-03-11 08:55:12 +00:00
2020-03-11 08:55:12 +00:00
2020-04-28 15:24:07 +02:00
2020-02-14 05:35:29 +00:00
2020-02-14 08:45:59 +00:00
2020-02-14 08:45:59 +00:00
2020-03-09 16:25:35 +01:00
2020-03-11 08:55:12 +00:00
2020-02-14 05:35:29 +00:00
2020-04-20 09:43:23 +02:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 08:45:59 +00:00
2020-04-30 00:09:48 +10:00
2020-03-12 00:38:37 -07:00
2020-02-21 07:05:31 +00:00
2020-02-14 08:45:59 +00:00
2020-02-16 18:07:27 +01:00
2020-02-16 18:07:27 +01:00
2020-02-14 08:45:59 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-03-11 08:55:12 +00:00
2020-05-01 06:54:26 +02:00
2020-05-01 06:54:26 +02:00
2020-05-01 06:54:26 +02:00
2020-05-01 06:54:26 +02:00
2020-02-14 05:35:29 +00:00
2020-02-14 08:45:59 +00:00
2020-03-11 08:55:12 +00:00
2020-05-01 06:54:27 +02:00
2020-05-01 06:54:27 +02:00
2020-05-01 06:54:26 +02:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-03-12 00:38:37 -07:00
2020-03-13 13:17:46 +11:00
2020-02-13 21:28:35 +00:00
2020-03-11 08:55:12 +00:00
2020-02-21 07:05:31 +00:00
2020-02-12 14:51:18 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-03-12 00:38:37 -07:00
2020-02-14 08:45:59 +00:00
2020-04-08 08:52:58 +02:00
2020-02-14 05:35:29 +00:00
2020-02-17 14:43:46 -08:00
2020-04-21 17:24:09 -07:00
2020-02-14 05:35:29 +00:00
2020-02-21 07:05:31 +00:00
2020-02-14 08:45:59 +00:00
2020-02-14 08:45:59 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 08:45:59 +00:00
2020-03-11 08:55:12 +00:00
2020-02-13 21:28:35 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-04-03 10:04:24 +02:00
2020-02-14 08:45:59 +00:00
2020-02-14 05:35:29 +00:00
2020-02-14 05:35:29 +00:00
2020-03-11 08:55:12 +00:00
2020-03-11 08:55:12 +00:00
2020-02-12 14:51:18 +00:00
2020-03-11 08:55:12 +00:00
2020-02-14 08:45:59 +00:00
2020-04-03 10:04:07 +02:00
2020-02-21 07:05:31 +00:00
2020-02-12 14:51:18 +00:00
2020-02-21 07:05:31 +00:00
2020-04-20 19:13:47 +10:00
2020-02-14 08:45:59 +00:00
2020-04-16 16:04:28 +02:00
2020-02-14 05:35:29 +00:00
2020-03-17 15:33:23 -07:00
2020-02-14 08:45:59 +00:00