FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
LCS/ReMapDictionary.cs at master · OZ1/LCS · GitHub
OZ1
/
LCS
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
LCS
/
ReMapDictionary.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
26 lines (24 loc) · 624 Bytes
Breadcrumbs
LCS
/
ReMapDictionary.cs
Copy path
File metadata and controls
26 lines (24 loc) · 624 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using
System
.
Collections
.
Concurrent
;
using
System
.
Collections
.
Generic
;
namespace
LCS
{
class
ReMapDictionary
:
ConcurrentDictionary
<
ReMapKey
,
int
>
{
public
bool
TryAdd
(
int
source
,
byte
ending
,
int
index
,
out
int
start
)
{
var
key
=
new
ReMapKey
(
source
,
ending
)
;
start
=
GetOrAdd
(
key
,
index
)
;
return
start
==
index
;
}
}
class
ReMapDictionaryST
:
Dictionary
<
ReMapKey
,
int
>
{
public
bool
TryAdd
(
int
source
,
byte
ending
,
int
index
,
out
int
start
)
{
var
key
=
new
ReMapKey
(
source
,
ending
)
;
if
(
TryGetValue
(
key
,
out
start
)
)
return
false
;
else
Add
(
key
,
start
=
index
)
;
return
true
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL