Skip to content

Commit

Permalink
Fixed the bug in contains function; Fixed detection of inside package
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaxin Cheng committed Sep 4, 2018
1 parent 1b7406d commit 6a5b039
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TonnerreSearch/FS Detector/TonnerreFSDetector.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class TonnerreFSDetector {
let filteredEvents = zip(filePaths, fileFlags).filter {
let components = $0.0.components(separatedBy: "/")
let hiddenFile = (components.last ?? "").starts(with: ".")
let insidePack = $0.0.range(of: "\\.\\w+/.+", options: .regularExpression, range: nil, locale: nil) != nil
let insidePack = $0.0.range(of: "\\.(app|tne)/.+", options: .regularExpression, range: nil, locale: nil) != nil
return !hiddenFile && !insidePack
}
let lastEventID = eventIds[numEvents - 1]
Expand Down
2 changes: 1 addition & 1 deletion TonnerreSearch/FS Detector/TonnerreFSEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ public extension Array where Element == TonnerreFSEvent {
*/
public func contains(_ element: Element) -> Bool {
let union = self.reduce(0) { $0 | $1.rawValue }
return union & element.rawValue == 1
return union & element.rawValue == element.rawValue
}
}

0 comments on commit 6a5b039

Please sign in to comment.