Skip to content

Commit

Permalink
Merge 0cfced0 into b4c8ea1
Browse files Browse the repository at this point in the history
  • Loading branch information
TimOliver committed May 18, 2018
2 parents b4c8ea1 + 0cfced0 commit 017857a
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 85 deletions.
Expand Up @@ -185,7 +185,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0810;
LastUpgradeCheck = 0900;
LastUpgradeCheck = 0930;
ORGANIZATIONNAME = Instagram;
TargetAttributes = {
888609041DEF38A00019A4A5 = {
Expand Down Expand Up @@ -337,13 +337,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down Expand Up @@ -393,13 +395,15 @@
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0900"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -14,7 +14,7 @@
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0517E9796FB44301E6D767DCCFBD2F9D"
BlueprintIdentifier = "8F76F6C33237D48542090C315ADA9C0F"
BuildableName = "IGListKit.framework"
BlueprintName = "IGListKit"
ReferencedContainer = "container:Pods/Pods.xcodeproj">
Expand All @@ -40,7 +40,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
Expand All @@ -60,7 +59,6 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = ""
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
13 changes: 6 additions & 7 deletions Examples/Examples-macOS/IGListKitExamples/Helpers/Shuffle.swift
Expand Up @@ -18,16 +18,15 @@ extension MutableCollection {

/// Shuffles the contents of this collection.
mutating func shuffle() {
let c = count
guard c > 1 else { return }
guard count > 1 else { return }

for (firstUnshuffled, unshuffledCount) in zip(indices, stride(from: c, to: 1, by: -1)) {
let d: IndexDistance = numericCast(arc4random_uniform(numericCast(unshuffledCount)))
guard d != 0 else { continue }
for (firstUnshuffled, unshuffledCount) in zip(indices, stride(from: count, to: 1, by: -1)) {
let distance: Int = numericCast(arc4random_uniform(numericCast(unshuffledCount)))
guard distance != 0 else { continue }

let i = index(firstUnshuffled, offsetBy: d)
let shuffleIndex = index(firstUnshuffled, offsetBy: distance)

self.swapAt(firstUnshuffled, i)
self.swapAt(firstUnshuffled, shuffleIndex)
}
}

Expand Down
Expand Up @@ -30,7 +30,7 @@ final class UsersProvider {
throw UsersError.invalidData
}

self.users = dicts.enumerated().flatMap { index, dict in
self.users = dicts.enumerated().compactMap { index, dict in
guard let name = dict["name"] else { return nil }

return User(pk: index, name: name.capitalized)
Expand Down

0 comments on commit 017857a

Please sign in to comment.