tuned;
authorwenzelm
Sun, 15 Jan 2023 20:38:27 +0100
changeset 76992 11c0747a87fc
parent 76991 6a078c80eab6
child 76993 a6d147b22b9b
tuned;
src/Pure/ML/ml_heap.scala
src/Pure/Tools/build_job.scala
--- a/src/Pure/ML/ml_heap.scala	Sun Jan 15 20:20:59 2023 +0100
+++ b/src/Pure/ML/ml_heap.scala	Sun Jan 15 20:38:27 2023 +0100
@@ -48,11 +48,9 @@
   }
 
   def write_digest(heap: Path): String =
-    read_digest(heap) match {
-      case None =>
-        val s = SHA1.digest(heap).toString
-        File.append(heap, sha1_prefix + s)
-        s
-      case Some(s) => s
+    read_digest(heap) getOrElse {
+      val s = SHA1.digest(heap).toString
+      File.append(heap, sha1_prefix + s)
+      s
     }
 }
--- a/src/Pure/Tools/build_job.scala	Sun Jan 15 20:20:59 2023 +0100
+++ b/src/Pure/Tools/build_job.scala	Sun Jan 15 20:38:27 2023 +0100
@@ -591,8 +591,9 @@
       else result1
 
     val heap_digest =
-      if (result2.ok && do_store && store.output_heap(session_name).is_file)
+      if (result2.ok && do_store && store.output_heap(session_name).is_file) {
         Some(ML_Heap.write_digest(store.output_heap(session_name)))
+      }
       else None
 
     (result2, heap_digest)