diff options
author | Bryan Newbold <bnewbold@archive.org> | 2018-07-24 13:39:48 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2018-07-24 13:39:48 -0700 |
commit | cd0769abe2fc7e0a91942e618dd00809fd058a70 (patch) | |
tree | 37319fc49a389c5511d1797bd849d5e8921302f8 /scalding | |
parent | 18bdcfd362a190dd36d3b86996808366b83bbbda (diff) | |
download | sandcrawler-cd0769abe2fc7e0a91942e618dd00809fd058a70.tar.gz sandcrawler-cd0769abe2fc7e0a91942e618dd00809fd058a70.zip |
small CdxBackfillJob refactor (code quality)
Diffstat (limited to 'scalding')
-rw-r--r-- | scalding/src/main/scala/sandcrawler/CdxBackfillJob.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scalding/src/main/scala/sandcrawler/CdxBackfillJob.scala b/scalding/src/main/scala/sandcrawler/CdxBackfillJob.scala index 389a96a..963fb10 100644 --- a/scalding/src/main/scala/sandcrawler/CdxBackfillJob.scala +++ b/scalding/src/main/scala/sandcrawler/CdxBackfillJob.scala @@ -108,12 +108,12 @@ object CdxBackfillJob { ) val lower = raw.toLowerCase() - normalMime.foreach { case (key, value) => - if (lower.startsWith(key)) { - return value - } + normalMime.find { case (key, _) => + lower.startsWith(key) + } match { + case Some((_, value)) => value + case None => lower } - lower } def isCdxLine(line: String) : Boolean = { |