Skip to content
This repository was archived by the owner on Aug 17, 2022. It is now read-only.

Xcode updates + Persian C style loop fix. #2

Merged
merged 7 commits into from
Dec 12, 2016
Merged

Xcode updates + Persian C style loop fix. #2

merged 7 commits into from
Dec 12, 2016

Conversation

bugKrusha
Copy link
Contributor

Mostly automatic updates from Xcode.

@aranasaurus
Copy link
Contributor

@bugKrusha looks good to me. I had to make a bunch of changes to fix some stuff that went awry with the upstream changes and this. That's all been done here, if you want to look them over and then merge the PR when you're done (or let me know if there's any changes you want me to make).

@@ -44,7 +44,7 @@ struct CodeChallengeEntry<ChallengeType: CodeChallengeType> {
let name: String

/// The block to be run to evaluate this entry.
let block: (_ input: ChallengeType.InputType) -> ChallengeType.OutputType
let block: (ChallengeType.InputType) -> ChallengeType.OutputType
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This required change is interesting 😩

for (i, accResult) in results.enumerated() {
var name = accResult.name
// try to make the results line up a bit by inserting the correct amount of tabs between the name and the avg based on the maximum name length vs this name's length
if name.characters.count < maxNameLength {
let diff = maxNameLength - name.characters.count
let tabWidth = 5
let tabsToInsert = Int(ceil(Double(diff)/Double(tabWidth)))
var tabsToInsert = Int(ceil(Double(diff)/Double(tabWidth)))
if diff % tabWidth == 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixes a spacing issue. When the name length was equal to the tabWidth it was only inserting 1 tab, when it should be 2.

Completely unrelated to the other changes, but I saw the problem and had to fix it 😆

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rather, the difference, not the name length, sorry.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really I think this hack should be done using spaces, not tabs anyway, not sure why I did that that way in the first place. But I didn't wanna refactor that bad in this change

@bugKrusha
Copy link
Contributor Author

@aranasaurus looks good to me so ima merge. Thanks for taking care of this 🙌

@bugKrusha bugKrusha merged commit 86fbfc7 into master Dec 12, 2016
@aranasaurus aranasaurus deleted the swift3 branch December 12, 2016 21:04
@aranasaurus aranasaurus changed the title WIP: Xcode updates + Persian C style loop fix. Xcode updates + Persian C style loop fix. Dec 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants