From c5ba0f22de7cc1ae563ce26423065e261100e854 Mon Sep 17 00:00:00 2001
From: Manos Koukoutos <emmanouil.koukoutos@epfl.ch>
Date: Wed, 10 Aug 2016 11:43:10 +0200
Subject: [PATCH] Remove unneeded utils, small fixes

---
 .../inox/solvers/z3/NativeZ3Solver.scala      |  1 -
 .../scala/inox/utils/FreeableIterator.scala   |  6 ++--
 src/main/scala/inox/utils/GraphOps.scala      |  3 +-
 .../scala/inox/utils/GrowableIterable.scala   | 36 -------------------
 src/main/scala/inox/utils/Report.scala        |  8 -----
 5 files changed, 4 insertions(+), 50 deletions(-)
 delete mode 100644 src/main/scala/inox/utils/GrowableIterable.scala
 delete mode 100644 src/main/scala/inox/utils/Report.scala

diff --git a/src/main/scala/inox/solvers/z3/NativeZ3Solver.scala b/src/main/scala/inox/solvers/z3/NativeZ3Solver.scala
index 8ac204fcc..7d1eeccc7 100644
--- a/src/main/scala/inox/solvers/z3/NativeZ3Solver.scala
+++ b/src/main/scala/inox/solvers/z3/NativeZ3Solver.scala
@@ -3,7 +3,6 @@
 package inox
 package solvers.z3
 
-import utils._
 import solvers.{z3 => _, _}
 import unrolling._
 import theories._
diff --git a/src/main/scala/inox/utils/FreeableIterator.scala b/src/main/scala/inox/utils/FreeableIterator.scala
index d517c87dd..d781991a8 100644
--- a/src/main/scala/inox/utils/FreeableIterator.scala
+++ b/src/main/scala/inox/utils/FreeableIterator.scala
@@ -23,7 +23,7 @@ abstract class FreeableIterator[T] extends Iterator[T] {
 
   override def map[B](f: T => B): FreeableIterator[B] = {
     new FreeableIterator[B] {
-      def computeNext() = orig.computeNext.map(f)
+      def computeNext() = orig.computeNext().map(f)
       def free() = orig.free()
     }
   }
@@ -35,7 +35,7 @@ abstract class FreeableIterator[T] extends Iterator[T] {
       def computeNext() = {
         if (c < n) {
           c += 1
-          orig.computeNext
+          orig.computeNext()
         } else {
           None
         }
@@ -47,7 +47,7 @@ abstract class FreeableIterator[T] extends Iterator[T] {
 
   override def takeWhile(p: T => Boolean) = {
     new FreeableIterator[T] {
-      def computeNext(): Option[T] = orig.computeNext.filter(p)
+      def computeNext(): Option[T] = orig.computeNext().filter(p)
       def free(): Unit = orig.free()
     }
   }
diff --git a/src/main/scala/inox/utils/GraphOps.scala b/src/main/scala/inox/utils/GraphOps.scala
index bf97bfd33..79788aa98 100644
--- a/src/main/scala/inox/utils/GraphOps.scala
+++ b/src/main/scala/inox/utils/GraphOps.scala
@@ -16,8 +16,7 @@ object GraphOps {
       if (noPreds.isEmpty) {
         if (hasPreds.isEmpty) Right(done.reverse) 
         else Left(hasPreds.keySet)
-      } 
-      else {
+      } else {
         val found : Seq[A] = noPreds.keys.toSeq
         tSort(hasPreds mapValues { _ -- found }, found ++ done)    
       }
diff --git a/src/main/scala/inox/utils/GrowableIterable.scala b/src/main/scala/inox/utils/GrowableIterable.scala
deleted file mode 100644
index c87f3af5e..000000000
--- a/src/main/scala/inox/utils/GrowableIterable.scala
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Copyright 2009-2016 EPFL, Lausanne */
-
-package inox.utils
-
-import scala.collection.mutable.ArrayBuffer
-
-class GrowableIterable[T](init: Seq[T], growth: Iterator[T]) extends Iterable[T] {
-  private var buffer = new ArrayBuffer[T]() ++ init
-
-  var canGrow = () => true
-
-  private val cachingIterator = new Iterator[T] {
-    def hasNext = canGrow() && growth.hasNext
-
-    def next() = {
-      val res = growth.next()
-      buffer += res
-      res
-    }
-  }
-
-  def += (more: T)           = buffer +=  more
-  def ++=(more: Iterable[T]) = buffer ++= more
-  def -= (less: T)           = buffer -=  less
-  def --=(less: Iterable[T]) = buffer --= less
-
-  def iterator: Iterator[T] = {
-    buffer.iterator ++ cachingIterator
-  }
-
-  def bufferedCount = buffer.size
-
-  def sortBufferBy[B](f: T => B)(implicit ord: math.Ordering[B]) = {
-    buffer = buffer.sortBy(f)
-  }
-}
diff --git a/src/main/scala/inox/utils/Report.scala b/src/main/scala/inox/utils/Report.scala
deleted file mode 100644
index 038e3fdc9..000000000
--- a/src/main/scala/inox/utils/Report.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Copyright 2009-2016 EPFL, Lausanne */
-
-package inox.utils
-
-/** Represents a pretty-printable report */
-abstract class Report {
-  def summaryString: String
-}
-- 
GitLab