This is an automated email from the ASF dual-hosted git repository.

sergeykamov pushed a commit to branch NLPCRAFT-504
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-504 by this push:
     new 77c33e77 Minor fixes.
77c33e77 is described below

commit 77c33e773f5856227fbc4128de2f8f941488a26c
Author: Sergey Kamov <[email protected]>
AuthorDate: Wed Jul 6 21:53:39 2022 +0300

    Minor fixes.
---
 .../main/scala/org/apache/nlpcraft/internal/util/NCResourceReader.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/util/NCResourceReader.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/util/NCResourceReader.scala
index e4285f00..d3e9388d 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/util/NCResourceReader.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/util/NCResourceReader.scala
@@ -90,7 +90,7 @@ object NCResourceReader extends LazyLogging:
         val nameLen = f.getName.length
 
         md5.
-            flatMap { (resPath, md5) => if path.endsWith(resPath) && 
resPath.length >= nameLen then Option(md5) else None }.
+            flatMap { (resPath, md5) => Option.when(path.endsWith(resPath) && 
resPath.length >= nameLen)(md5) }.
             to(LazyList).
             headOption.
             getOrElse(throw new NCException(s"MD5 data not found for: 
'$path'"))

Reply via email to