fix: bugs in zpopmin/zpopmax;
Details: #135
Because zadd defaults to (RESPValue, Double), scoreIsFirst is set to false by default.
zadd function:
@inlinable
public func zadd<Value: RESPValueConvertible>(
_ elements: [(element: Value, score: Double)],
to key: RedisKey,
inserting insertBehavior: RedisZaddInsertBehavior = .allElements,
returning returnBehavior: RedisZaddReturnBehavior = .insertedElementsCount
) -> EventLoopFuture<Int> {
var args: [RESPValue] = [.init(from: key)]
args.append(convertingContentsOf: [insertBehavior.string, returnBehavior.string].compactMap({ $0 }))
args.add(contentsOf: elements, overestimatedCountBeingAdded: elements.count * 2) { (array, next) in
array.append(.init(bulk: next.score.description))
array.append(next.element.convertedToRESPValue())
}
return self.send(command: "ZADD", with: args)
.tryConverting()
}
@fabianfett @0xTim pls review! :)
Has this project been forgotten? @Joannis @fabianfett @Mordil
@iwecon it's been superceded by the official Valkey client: https://github.com/valkey-io/valkey-swift Valkey is the OpenSource fork of Redis powered by the Linux Foundation, highly recommend you use thhat library going forward.
@iwecon it's been superceded by the official Valkey client: https://github.com/valkey-io/valkey-swift Valkey is the OpenSource fork of Redis powered by the Linux Foundation, highly recommend you use thhat library going forward.
Ah, okay. Is this repository no longer being maintained?
Ah, okay. Is this repository no longer being maintained?
@iwecon practically yes, however I can merge the changes and do a release for this given it's a small patch
@iwecon I don't permissions to bypass the checks so you'll need to get CI passing