aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2016-10-26 19:43:05 -0400
committerEduardo Julian2016-10-26 19:43:05 -0400
commit7cbe516e7e3c56f249515744d76fbc3ee9653068 (patch)
tree4af89ae96f2654923a5eac41d7b9c4d2829722dc
parentdffc33d4e3beeac1f904cab8d6630674b5c03239 (diff)
- Slight optimization to bool PM.
-rw-r--r--src/lux/base.clj3
-rw-r--r--src/lux/compiler/case.clj3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lux/base.clj b/src/lux/base.clj
index da5ef48f8..a4e2c3096 100644
--- a/src/lux/base.clj
+++ b/src/lux/base.clj
@@ -298,6 +298,9 @@
(defmacro |let [bindings body]
(reduce (fn [inner [left right]]
+ (if (symbol? left)
+ `(let [~left ~right]
+ ~inner))
`(|case ~right
~left
~inner))
diff --git a/src/lux/compiler/case.clj b/src/lux/compiler/case.clj
index 9d709bae2..9acf3854d 100644
--- a/src/lux/compiler/case.clj
+++ b/src/lux/compiler/case.clj
@@ -72,8 +72,7 @@
(doto writer
stack-peek
&&/unwrap-boolean
- (.visitLdcInsn _value)
- (.visitJumpInsn Opcodes/IF_ICMPNE $else))
+ (.visitJumpInsn (if _value Opcodes/IFEQ Opcodes/IFNE) $else))
(&o/$NatPM _value)
(doto writer