Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
2c18b5d7
Commit
2c18b5d7
authored
Sep 04, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
investigate and fix #940 - boxed args bounds fail
parent
d58fd589
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
Literals.cs
src/NRediSearch/Literals.cs
+1
-1
Issue940.cs
tests/NRediSearch.Test/Isssues/Issue940.cs
+17
-0
No files found.
src/NRediSearch/Literals.cs
View file @
2c18b5d7
...
...
@@ -45,6 +45,6 @@ public static object Literal(this string value)
/// Obtain a pre-boxed integer if possible, else box the inbound value
/// </summary>
/// <param name="value">The value to get a pre-boxed integer for.</param>
public
static
object
Boxed
(
this
int
value
)
=>
value
>=
BOXED_MIN
&&
value
<
=
BOXED_MAX
?
s_Boxed
[
value
-
BOXED_MIN
]
:
value
;
public
static
object
Boxed
(
this
int
value
)
=>
value
>=
BOXED_MIN
&&
value
<
BOXED_MAX
?
s_Boxed
[
value
-
BOXED_MIN
]
:
value
;
}
}
tests/NRediSearch.Test/Isssues/Issue940.cs
0 → 100644
View file @
2c18b5d7
using
Xunit
;
namespace
NRediSearch.Test
{
public
class
Issue940
{
[
Fact
]
public
void
Paging_Boxing
()
{
for
(
int
i
=
-
20
;
i
<
100
;
i
++)
{
var
boxed
=
i
.
Boxed
();
Assert
.
Equal
(
i
,
(
int
)
boxed
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment