Skip to content

Commit

Permalink
Minor refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Dal-Pra authored and slandelle committed Sep 18, 2019
1 parent e635d3e commit 7f1232a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
Expand Up @@ -27,11 +27,7 @@ private[stats] object SessionDeltas {
val Empty = SessionDeltas(0, 0)
}

private[stats] final case class SessionDeltas(starts: Int, ends: Int) {

def addStart() = copy(starts = starts + 1)
def addEnd() = copy(ends = ends + 1)
}
private[stats] final case class SessionDeltas(starts: Int, ends: Int)

private[stats] class SessionDeltaBuffer(minTimestamp: Long, maxTimestamp: Long, buckets: Array[Int], runDurationInSeconds: Int) {

Expand Down
Expand Up @@ -104,13 +104,9 @@ private[css] object FormExtractor {
} yield {
val childNode = currentNode.getChild(i)
childNode.getNodeName match {
case "input" => extractInput(childNode).map(Seq(_)).getOrElse(Nil)
case "select" =>
extractSelect(childNode) match {
case Some(input) => Seq(input)
case None => Nil
}
case "textarea" => extractTextArea(childNode).map(Seq(_)).getOrElse(Nil)
case "input" => extractInput(childNode).toList
case "select" => extractSelect(childNode).toList
case "textarea" => extractTextArea(childNode).toList
case _ => processFormRec(childNode, inputs)
}
}
Expand Down
Expand Up @@ -26,7 +26,9 @@ package object regex {

def foldLeft[T](zero: T)(f: (JMatcher, T) => T): T = {
var temp = zero
while (matcher.find) temp = f(matcher, temp)
while (matcher.find) {
temp = f(matcher, temp)
}
temp
}

Expand Down

0 comments on commit 7f1232a

Please sign in to comment.