diff --git a/artifacts/exe/Firefly b/artifacts/exe/Firefly index 9d30881..a6e9ea5 100644 Binary files a/artifacts/exe/Firefly and b/artifacts/exe/Firefly differ diff --git a/artifacts/exe/Firefly.dbg b/artifacts/exe/Firefly.dbg index 3c03272..2321fd4 100644 Binary files a/artifacts/exe/Firefly.dbg and b/artifacts/exe/Firefly.dbg differ diff --git a/artifacts/exe/Firefly.exe b/artifacts/exe/Firefly.exe index c3a617b..035aeb5 100644 Binary files a/artifacts/exe/Firefly.exe and b/artifacts/exe/Firefly.exe differ diff --git a/artifacts/exe/Firefly.pdb b/artifacts/exe/Firefly.pdb index dc4b1d0..6ac887d 100644 Binary files a/artifacts/exe/Firefly.pdb and b/artifacts/exe/Firefly.pdb differ diff --git a/artifacts/exe/Firefly.xml b/artifacts/exe/Firefly.xml index fd2e5e4..db4c865 100644 --- a/artifacts/exe/Firefly.xml +++ b/artifacts/exe/Firefly.xml @@ -227,6 +227,13 @@ Command arguments containing the key The popped value or nil if the list is empty + + + Handles the LLEN command which returns the length of a list. + + Command arguments containing the key + The length of the list or 0 if the key does not exist + Handles the LRANGE command which returns a range of elements from a list. diff --git a/artifacts/native/Firefly.dll b/artifacts/native/Firefly.dll index af6f26b..5a4a6b3 100644 Binary files a/artifacts/native/Firefly.dll and b/artifacts/native/Firefly.dll differ diff --git a/artifacts/native/Firefly.pdb b/artifacts/native/Firefly.pdb index 1d98a73..f362799 100644 Binary files a/artifacts/native/Firefly.pdb and b/artifacts/native/Firefly.pdb differ diff --git a/artifacts/native/Firefly.xml b/artifacts/native/Firefly.xml index fd2e5e4..db4c865 100644 --- a/artifacts/native/Firefly.xml +++ b/artifacts/native/Firefly.xml @@ -227,6 +227,13 @@ Command arguments containing the key The popped value or nil if the list is empty + + + Handles the LLEN command which returns the length of a list. + + Command arguments containing the key + The length of the list or 0 if the key does not exist + Handles the LRANGE command which returns a range of elements from a list. diff --git a/src/ListOperations.cs b/src/ListOperations.cs index 58fb450..b9ba45d 100644 --- a/src/ListOperations.cs +++ b/src/ListOperations.cs @@ -165,13 +165,9 @@ namespace Firefly } string key = args.Trim(); - int length = 0; - - // Use helper function to safely read the list with read lock - ListStoreWithReadLock(key, list => - { - length = list.Count; - }); + + // Change to use the generic method correctly by returning the length + int length = ListStoreWithReadLock(key, list => list.Count); return Encoding.UTF8.GetBytes($":{length}\r\n"); }