Skip to content

Commit

Permalink
New: diff parameters lindex and rindex
Browse files Browse the repository at this point in the history
New Paramter for Left-Index and Right-Index: lindex and rindex
  • Loading branch information
rzander committed Feb 8, 2018
1 parent d9a3e95 commit d9af42a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 10 additions & 1 deletion source/jaindb/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,19 @@ public JObject Diff()
if (!int.TryParse(query.FirstOrDefault(t => t.Key.ToLower() == "index").Value, out int index))
index = 0;

if (!int.TryParse(query.FirstOrDefault(t => t.Key.ToLower() == "lindex").Value, out int lindex))
lindex = 0;

if (index == 0)
index = lindex;

if (!int.TryParse(query.FirstOrDefault(t => t.Key.ToLower() == "rindex").Value, out int rindex))
rindex = -1;

if (!int.TryParse(query.FirstOrDefault(t => t.Key.ToLower() == "mode").Value, out int mode))
mode = 0;

return jDB.GetDiff(sKey, index, mode);
return jDB.GetDiff(sKey, index, mode, rindex);
}
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions source/jaindb/jaindb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<RepositoryUrl>https://github.com/rzander/jaindb</RepositoryUrl>
<PackageTags>blockchain json</PackageTags>
<Version>0.9.0</Version>
<AssemblyVersion>0.9.0.21</AssemblyVersion>
<FileVersion>0.9.0.21</FileVersion>
<AssemblyVersion>0.9.0.24</AssemblyVersion>
<FileVersion>0.9.0.24</FileVersion>
<StartupObject>jaindb.Program</StartupObject>
<UserSecretsId>fcfd6c0a-e53c-46cb-8a9d-b786c0579861</UserSecretsId>
</PropertyGroup>
Expand Down

0 comments on commit d9af42a

Please # to comment.