Skip to content

Commit

Permalink
Merge pull request #3 from JimRoepcke/feature/do-not-use-set-in-index…
Browse files Browse the repository at this point in the history
…esWithKeys

Do not use Set(keys) in indexesWithKeys
  • Loading branch information
JimRoepcke authored Feb 13, 2018
2 parents 4d56966 + 2a2aa21 commit 86eb549
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Sources/YapDatabaseExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ extension Persistable {
Keys>(_ keys: Keys) -> [YapDB.Index] where
Keys: Sequence,
Keys.Iterator.Element == String {
return Set(keys).map { YapDB.Index(collection: collection, key: $0) }
return keys.map { YapDB.Index(collection: collection, key: $0) }
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Tests/YapDatabaseExtensionsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class PersistableTests: XCTestCase {
func test__indexes_from_keys() {
let keys = [ "beatle-1", "beatle-2", "beatle-3", "beatle-4", "beatle-2" ]
let indexes = Person.indexesWithKeys(keys)
XCTAssertEqual(indexes.count, 4)
XCTAssertEqual(indexes.count, 5)
}
}

Expand Down

0 comments on commit 86eb549

Please sign in to comment.