minor table access optimization
authorblanchet
Tue, 24 Jun 2014 14:56:08 +0200
changeset 57305 cc2a82032058
parent 57304 d2061dc953a4
child 57306 ff10067b2248
minor table access optimization
src/HOL/Tools/Sledgehammer/sledgehammer_mash.ML
--- a/src/HOL/Tools/Sledgehammer/sledgehammer_mash.ML	Tue Jun 24 13:48:14 2014 +0200
+++ b/src/HOL/Tools/Sledgehammer/sledgehammer_mash.ML	Tue Jun 24 14:56:08 2014 +0200
@@ -497,7 +497,7 @@
         fun add_th weight t =
           let
             val im = Array.sub (sfreq, t)
-            fun fold_fn s sf = Inttab.update (s, weight + the_default 0 (Inttab.lookup im s)) sf
+            fun fold_fn s sf = Inttab.map_default (s, 0) (Integer.add weight) sf
           in
             Array.update (tfreq, t, weight + Array.sub (tfreq, t));
             Array.update (sfreq, t, fold fold_fn feats im)