Skip to content

Commit

Permalink
Clarify usage comment for set() functions (#67)
Browse files Browse the repository at this point in the history
It was not immediately clear that supplying a value of false for the "exists" argument has a special meaning. It causes the "NX" argument to be sent to Redis, as opposed to no argument when supplying a value of nil. At least that was my experience when using this function for the first time - the implications of true/false/nil were not explained until I read the source code for this function.
  • Loading branch information
mr-j-tree authored and ianpartridge committed Jul 19, 2018
1 parent ed9501c commit 7f4c7f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/SwiftRedis/Redis+Basic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ extension Redis {
///
/// - Parameter key: The key.
/// - Parameter value: The String value to set.
/// - Parameter exists: If true will only set the key if it already exists.
/// - Parameter exists: If true will only set the key if it already exists. If false will only set the key if it doesn't already exist.
/// - Parameter expiresIn: If not nil, the expiration time, in milliseconds.
/// - Parameter callback: The callback function after setting the value. Bool will be
/// true if the key was set. NSError will be non-nil if an error occurred.
Expand All @@ -628,7 +628,7 @@ extension Redis {
///
/// - Parameter key: The key.
/// - Parameter value: The `RedisString` value to set.
/// - Parameter exists: If true will only set the key if it already exists.
/// - Parameter exists: If true will only set the key if it already exists. If false will only set the key if it doesn't already exist.
/// - Parameter expiresIn: If not nil, the expiration time, in milliseconds.
/// - Parameter callback: The callback function after setting the value. Bool will be
/// true if the key was set. NSError will be non-nil if an error occurred.
Expand Down

0 comments on commit 7f4c7f1

Please sign in to comment.