Skip to content

Improvements in the code#55

Merged
aschuch merged 6 commits into
aschuch:masterfrom
Vkt0r:improvements
Mar 12, 2016
Merged

Improvements in the code#55
aschuch merged 6 commits into
aschuch:masterfrom
Vkt0r:improvements

Conversation

@Vkt0r

@Vkt0r Vkt0r commented Mar 12, 2016

Copy link
Copy Markdown
Contributor

Make improvements in the code and refactoring to improve readability and clean syntax.

Vkt0r added 5 commits March 11, 2016 18:13
- Add pattern matching with the where clause in the if statement improving clean syntax and improvements of Swift 2.
- Change () for Void in every closure to improve the clarity in the code and following the guidelines of using closures in Swift.
- Add two typealias to the closures in the function setObjectForKey() to improve reusability and readibility in the code .
- Add pattern matching with the where clause in the if statement improving clean syntax and improvements of Swift 2.
- Change () for Void in every closure to improve the clarity in the code and following the guidelines of using closures in Swift.
- Add two typealias to the closures in the function setObjectForKey() to improve reusability and readibility in the code .
Remove force unwrapping to avoid any runtime error, make a more secure code to runtime errors.
Change the do-catch statement error handling for creating an optional with wildcard.
- Change the regular expression for a more short syntax calling directly the function stringByReplacingOccurrencesOfString() with the regular expression.
- Change do-catch statement with optional in case of error.
@Vkt0r Vkt0r changed the title Improvements ine the code Improvements in the code Mar 12, 2016
Comment thread AwesomeCache/Cache.swift
/// Typealias to define the reusability in declaration of the closures.
public typealias cacheBlockClosure = (T, CacheExpiry) -> Void
public typealias errorClosure = (NSError?) -> Void

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

These should better start with a capital letter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, agree 👍

@aschuch

aschuch commented Mar 12, 2016

Copy link
Copy Markdown
Owner

Thanks, just a minor remark, then I am happy to merge :)

@Vkt0r

Vkt0r commented Mar 12, 2016

Copy link
Copy Markdown
Contributor Author

Done @aschuch , thanks for you quickly revision 😃

aschuch added a commit that referenced this pull request Mar 12, 2016
@aschuch aschuch merged commit 26b9dac into aschuch:master Mar 12, 2016
@aschuch

aschuch commented Mar 12, 2016

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants