Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pcantrell
Created April 14, 2018 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pcantrell/f49ca6691541bd9dcb248592518d03d9 to your computer and use it in GitHub Desktop.
Save pcantrell/f49ca6691541bd9dcb248592518d03d9 to your computer and use it in GitHub Desktop.
contains(where:) usage in Swift source compat suite
project_cache/GRDB.swift/Tests/GRDBTests/CursorTests.swift: XCTAssertTrue(try IteratorCursor([1, 2]).contains { $0 == 1 })
project_cache/GRDB.swift/Tests/GRDBTests/CursorTests.swift: XCTAssertFalse(try IteratorCursor([1, 2]).contains { $0 == 3 })
project_cache/GRDB.swift/Tests/GRDBTests/CursorTests.swift: _ = try IteratorCursor([1, 2]).contains { _ -> Bool in throw TestError() }
project_cache/GRDB.swift/GRDB/Core/SchedulingWatchdog.swift: return allowedDatabases.contains { $0 === db }
project_cache/GRDB.swift/GRDB/Core/Database.swift: if !observersForCommit.contains(where: { $0 === observer }) {
project_cache/GRDB.swift/GRDB/Record/TableMapping.swift: guard lhs.contains(where: { !$1.isNull }) else { return false }
project_cache/GRDB.swift/GRDB/Record/TableMapping.swift: guard rhs.contains(where: { !$1.isNull }) else { return false }
project_cache/GRDB.swift/GRDB/Record/Persistable.swift: guard primaryKeyValues.contains(where: { !$0.isNull }) else { return nil }
project_cache/GRDB.swift/GRDB/Record/Persistable.swift: guard primaryKeyValues.contains(where: { !$0.isNull }) else { return nil }
project_cache/GRDB.swift/GRDB/Record/Persistable.swift: guard primaryKeyValues.contains(where: { !$0.isNull }) else { return nil }
project_cache/R.swift/Sources/RswiftCore/ResourceTypes/AssetFolder.swift: let isPropertiesFile = assetPropertiesFilenames.contains(where: { arg -> Bool in
project_cache/R.swift/Sources/RswiftCore/Generators/StringsStructGenerator.swift: if ps.contains(where: { $0.spec == FormatSpecifier.topType }) {
project_cache/R.swift/Sources/RswiftCore/Generators/StringsStructGenerator.swift: let containsBase = values.contains { $0.0.isBase }
project_cache/R.swift/Sources/RswiftCore/Generators/StringsStructGenerator.swift: let anyNone = values.contains { $0.0.isNone }
project_cache/siesta/Examples/GithubBrowser/Source/UI/CommentaryViewController.swift: && subviews.contains(where:
project_cache/vapor/Tests/VaporTests/CORSMiddlewareTests.swift: XCTAssertFalse(response.headers.contains(where: { $0.0 == "Access-Control-Allow-Origin" }), "")
project_cache/AsyncNinja/Tests/AsyncNinjaTests/EventSource_ToFutureTests.swift: source.contains { $0 >= 10 }
project_cache/AsyncNinja/Tests/AsyncNinjaTests/EventSource_ToFutureTests.swift: source.contains { $0 >= 10 }
project_cache/AsyncNinja/Sources/EventSource_Transform.swift: && !zip(lhs, rhs).contains { $0.0 != $0.1 }
project_cache/AsyncNinja/Sources/appleOS.swift: && !zip(lhs, rhs).contains { !$0.0.isEqual($0.1) }
project_cache/ProcedureKit/Sources/TestingProcedureKit/TestProcedure.swift: return (errors.count == count) && errors.contains { ($0 as? TestError) ?? TestError() == error }
project_cache/ReactiveSwift/Sources/Signal.swift: return Swift.zip(values, isCompleted).contains(where: { $0.0.isEmpty && $0.1 })
project_cache/Kickstarter-Prelude/Prelude/Array.swift: if !result.contains(where: { eq(x, $0) }) {
project_cache/Sourcery/SourceryRuntime/Sources/Protocol.swift: type.variables = type.variables.filter({ v in !variables.contains(where: { $0.name == v.name && $0.isStatic == v.isStatic }) })
project_cache/Sourcery/SourceryRuntime/Sources/Type.swift: !all.contains(where: { $0.name == extracted.name && $0.isStatic == extracted.isStatic })
project_cache/Sourcery/SourceryRuntime/Sources/Enum.swift: return cases.contains(where: { $0.hasAssociatedValue })
project_cache/Sourcery/Pods/xcproj/Sources/xcproj/PBXProjObjects+Helpers.swift: if sourcesBuildPhases.contains(where: { _, val in val.files.contains(buildFileReference)}) {
project_cache/Sourcery/Pods/xcproj/Sources/xcproj/PBXProjObjects+Helpers.swift: } else if frameworksBuildPhases.contains(where: { _, val in val.files.contains(buildFileReference)}) {
project_cache/Sourcery/Pods/xcproj/Sources/xcproj/PBXProjObjects+Helpers.swift: } else if resourcesBuildPhases.contains(where: { _, val in val.files.contains(buildFileReference)}) {
project_cache/Sourcery/Pods/xcproj/Sources/xcproj/PBXProjObjects+Helpers.swift: } else if copyFilesBuildPhases.contains(where: { _, val in val.files.contains(buildFileReference)}) {
project_cache/Sourcery/Pods/xcproj/Sources/xcproj/PBXProjObjects+Helpers.swift: } else if headersBuildPhases.contains(where: { _, val in val.files.contains(buildFileReference)}) {
project_cache/Sourcery/Pods/xcproj/Sources/xcproj/PBXProjObjects+Helpers.swift: } else if carbonResourcesBuildPhases.contains(where: { _, val in val.files.contains(buildFileReference)}) {
project_cache/Sourcery/Pods/SourceKittenFramework/Source/SourceKittenFramework/SyntaxMap.swift: return SyntaxKind.docComments().contains { $0.rawValue == type }
project_cache/CoreStore/Sources/CSDataStack+Observing.swift: fetchClauses.contains { $0 is CSOrderBy },
project_cache/CoreStore/Sources/CSDataStack+Observing.swift: fetchClauses.contains { $0 is CSOrderBy },
project_cache/CoreStore/Sources/CSDataStack+Observing.swift: fetchClauses.contains { $0 is CSOrderBy },
project_cache/CoreStore/Sources/CSDataStack+Observing.swift: fetchClauses.contains { $0 is CSOrderBy },
project_cache/ReactiveCocoa/Carthage/Checkouts/ReactiveSwift/Sources/Signal.swift: return Swift.zip(values, isCompleted).contains(where: { $0.0.isEmpty && $0.1 })
project_cache/SwiftGraph/Sources/SwiftGraph/Cycle.swift: } else if !openPath.path.contains(where: { $0.u == neighborEdge.v || $0.v == neighborEdge.v }) && neighborEdge.v > head {
project_cache/ReSwift/ReSwift/CoreTypes/Store.swift: let contains = subscriptions.contains(where: { $0.subscriber === subscriber })
project_cache/Kingfisher/Sources/KingfisherOptionsInfo.swift: return contains{ $0 <== .forceRefresh }
project_cache/Kingfisher/Sources/KingfisherOptionsInfo.swift: return contains{ $0 <== .forceTransition }
project_cache/Kingfisher/Sources/KingfisherOptionsInfo.swift: return contains{ $0 <== .cacheMemoryOnly }
project_cache/Kingfisher/Sources/KingfisherOptionsInfo.swift: return contains{ $0 <== .onlyFromCache }
project_cache/Kingfisher/Sources/KingfisherOptionsInfo.swift: return contains{ $0 <== .backgroundDecode }
project_cache/Kingfisher/Sources/KingfisherOptionsInfo.swift: return contains { $0 <== .preloadAllGIFData }
project_cache/Kingfisher/Sources/KingfisherOptionsInfo.swift: return contains { $0 <== .keepCurrentImageWhileLoading }
project_cache/Kingfisher/Sources/KingfisherOptionsInfo.swift: return contains { $0 <== .onlyLoadFirstFrame }
project_cache/SwiftLint/Source/SwiftLintFramework/Models/Linter.swift: let isSuperflousRuleDisabled = regionsDisablingSuperflousDisableRule.contains { $0.contains(region.start) }
project_cache/SwiftLint/Source/SwiftLintFramework/Models/Linter.swift: let noViolationsInDisabledRegion = !allViolations.contains { violation in
project_cache/SwiftLint/Source/SwiftLintFramework/Extensions/File+SwiftLint.swift: return command.ruleIdentifiers.contains(where: restrictingRuleIdentifiers.contains)
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/FileLengthRule.swift: let hasViolation = configuration.severityConfiguration.params.contains {
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/CommaRule.swift: .contains(where: CommaRule.excludingSyntaxKindsForFirstCapture.contains)
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/CommaRule.swift: .contains(where: CommaRule.excludingSyntaxKindsForSecondCapture.contains)
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/CompilerProtocolInitRule.swift: return self.arguments.contains { $0 == arguments }
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/LetVarWhitespaceRule.swift: if SwiftDeclarationKind.nonVarAttributableKinds.contains(where: { $0.rawValue == kind }) {
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/LetVarWhitespaceRule.swift: if SwiftDeclarationKind.varKinds.contains(where: { $0.rawValue == kind }) {
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/LetVarWhitespaceRule.swift: return directives.contains(where: trimmed.hasPrefix)
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/ClosureSpacingRule.swift: return others.contains(where: isStrictSubset)
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/ForceUnwrappingRule.swift: .contains(where: ForceUnwrappingRule.excludingSyntaxKindsForFirstCapture.contains) else {
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/ForceUnwrappingRule.swift: .contains(where: ForceUnwrappingRule.excludingSyntaxKindsForSecondCapture.contains)
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/ExplicitEnumRawValueRule.swift: .filter { !$0.elements.contains { $0.kind == "source.lang.swift.structure.elem.init_expr" } }
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/ForWhereRule.swift: let doesntContainComments = !allKinds.contains { kind in
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/EmptyEnumArgumentsRule.swift: if callsRanges.contains(where: range.intersects) {
project_cache/SwiftLint/Source/SwiftLintFramework/Protocols/Rule.swift: return !zip(lhs, rhs).contains { !$0.0.isEqualTo($0.1) }
project_cache/SwiftLint/Tests/SwiftLintFrameworkTests/ConfigurationTests+Nested.swift: return rules.contains { $0 is T }
project_cache/SwiftLint/Carthage/Checkouts/SourceKitten/Source/SourceKittenFramework/SyntaxMap.swift: return SyntaxKind.docComments().contains { $0.rawValue == type }
project_cache/NetService/Sources/NetService/NetService.swift: if message.answers.flatMap({ $0 as? ServiceRecord }).contains(where: { $0.name == fqdn }) {
project_cache/R.swift/Sources/RswiftCore/Util/UtilExtensions.swift: return !(try contains(where: { !(try predicate($0)) }))
project_cache/siesta/Source/Siesta/Support/Collection+Siesta.swift: { return contains(where: predicate) }
project_cache/siesta/Source/Siesta/Support/Collection+Siesta.swift: { return !contains(where: { !predicate($0) }) }
project_cache/SwifterSwift/Sources/Extensions/SwiftStdlib/ArrayExtensions.swift: return try !contains { try !condition($0) }
project_cache/SwifterSwift/Sources/Extensions/SwiftStdlib/ArrayExtensions.swift: return try !contains { try condition($0) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment