mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Added support to get the start of an extent from any item in them.
This commit is contained in:
@@ -201,5 +201,19 @@ namespace Extents
|
||||
{
|
||||
return backend.ToArray();
|
||||
}
|
||||
|
||||
public bool GetStart(int item, out int start)
|
||||
{
|
||||
start = 0;
|
||||
foreach(Tuple<int, int> extent in backend)
|
||||
{
|
||||
if(item >= extent.Item1 && item <= extent.Item2)
|
||||
{
|
||||
start = extent.Item1;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user