summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRocky Madden <git@rockymadden.com>2012-10-15 18:28:13 -0600
committerRocky Madden <git@rockymadden.com>2012-10-15 18:28:13 -0600
commit78e92440eaa994292b2ebb91bc5b517ed27c8e40 (patch)
tree6f4ddfad731a0846df4004b2fc965727d49a6838
parenta2afc6432e3d7410e5468c0a1cfb312e4ad1c273 (diff)
downloadstringmetric-78e92440eaa994292b2ebb91bc5b517ed27c8e40.tar.gz
stringmetric-78e92440eaa994292b2ebb91bc5b517ed27c8e40.tar.bz2
stringmetric-78e92440eaa994292b2ebb91bc5b517ed27c8e40.zip
Added tailrec annotation.
-rwxr-xr-xcli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala b/cli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala
index 926ba8b..a3a0f16 100755
--- a/cli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala
+++ b/cli/source/core/scala/org/hashtree/stringmetric/cli/OptionMapUtility.scala
@@ -1,5 +1,6 @@
package org.hashtree.stringmetric.cli
+import scala.annotation.tailrec
import scala.collection.immutable.HashMap
/** Utility standalone for OptionMap based operations. */
@@ -12,6 +13,7 @@ object OptionMapUtility {
next(new HashMap[Symbol, String](), arguments)
}
+ @tailrec
private[this] def next(optionMap: OptionMap, arguments: List[String]): OptionMap = {
val double = """^(--[a-zA-Z0-9]+)(\=[a-zA-Z0-9\.\-\_]+)?""".r
val single = """^(-[a-zA-Z0-9]+)(\=[a-zA-Z0-9\.\-\_]+)?""".r