From f48464548caf92e776f4f3e4fe08158b37d9a0f6 Mon Sep 17 00:00:00 2001 From: ShikiSuen Date: Tue, 31 May 2022 20:46:30 +0800 Subject: [PATCH] ClangFormat the reverseWalk(). (#46) --- Sources/Megrez/1_BlockReadingBuilder.swift | 2 +- Sources/Megrez/4_Node.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Megrez/1_BlockReadingBuilder.swift b/Sources/Megrez/1_BlockReadingBuilder.swift index 1abe783..c8f5f1e 100644 --- a/Sources/Megrez/1_BlockReadingBuilder.swift +++ b/Sources/Megrez/1_BlockReadingBuilder.swift @@ -186,7 +186,7 @@ extension Megrez { var path: [NodeAnchor] = reverseWalk(at: location - nodeZero.spanningLength, score: nodeZero.accumulatedScore) path.insert(nodeZero, at: 0) paths.append(path) - } else if longPhrases.count > 0 { + } else if !longPhrases.isEmpty { var path = [NodeAnchor]() for theAnchor in nodes { guard let theNode = theAnchor.node else { continue } diff --git a/Sources/Megrez/4_Node.swift b/Sources/Megrez/4_Node.swift index 66b08de..813cc30 100644 --- a/Sources/Megrez/4_Node.swift +++ b/Sources/Megrez/4_Node.swift @@ -84,7 +84,7 @@ extension Megrez { $0.score > $1.score } - if mutUnigrams.count > 0 { + if !mutUnigrams.isEmpty { mutScore = mutUnigrams[0].score }