InputStream: move code to ExpensiveSeeking()
This commit is contained in:
parent
181edf4b53
commit
87eb5cbced
@ -67,10 +67,22 @@ InputStream::LockWaitReady()
|
|||||||
WaitReady();
|
WaitReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Is seeking on resources behind this URI "expensive"? For example,
|
||||||
|
* seeking in a HTTP file requires opening a new connection with a new
|
||||||
|
* HTTP request.
|
||||||
|
*/
|
||||||
|
gcc_pure
|
||||||
|
static bool
|
||||||
|
ExpensiveSeeking(const char *uri)
|
||||||
|
{
|
||||||
|
return uri_has_scheme(uri);
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
InputStream::CheapSeeking() const
|
InputStream::CheapSeeking() const
|
||||||
{
|
{
|
||||||
return IsSeekable() && !uri_has_scheme(uri.c_str());
|
return IsSeekable() && !ExpensiveSeeking(uri.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
Loading…
Reference in New Issue
Block a user