summaryrefslogtreecommitdiff
path: root/src/input/AsyncInputStream.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-11-10 19:24:33 +0100
committerMax Kellermann <max@musicpd.org>2017-11-10 19:24:33 +0100
commit49784513b13ae8c5a5811fab8439463964a9e151 (patch)
tree7c2bd603ff23a4cab138b38a15e2892588621dfd /src/input/AsyncInputStream.cxx
parent523051132d77cb5da01847592c4c1e1faae93c6a (diff)
util/{Const,Writable}Buffer, ...: rename IsEmpty() to empty(), imitating STL
Diffstat (limited to 'src/input/AsyncInputStream.cxx')
-rw-r--r--src/input/AsyncInputStream.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx
index 6d677d350..1cf4b81cd 100644
--- a/src/input/AsyncInputStream.cxx
+++ b/src/input/AsyncInputStream.cxx
@@ -88,7 +88,7 @@ bool
AsyncInputStream::IsEOF() noexcept
{
return (KnownSize() && offset >= size) ||
- (!open && buffer.IsEmpty());
+ (!open && buffer.empty());
}
void
@@ -108,7 +108,7 @@ AsyncInputStream::Seek(offset_type new_offset)
while (new_offset > offset) {
auto r = buffer.Read();
- if (r.IsEmpty())
+ if (r.empty())
break;
const size_t nbytes =
@@ -162,7 +162,7 @@ AsyncInputStream::IsAvailable() noexcept
{
return postponed_exception ||
IsEOF() ||
- !buffer.IsEmpty();
+ !buffer.empty();
}
size_t
@@ -176,7 +176,7 @@ AsyncInputStream::Read(void *ptr, size_t read_size)
Check();
r = buffer.Read();
- if (!r.IsEmpty() || IsEOF())
+ if (!r.empty() || IsEOF())
break;
cond.wait(mutex);
@@ -209,7 +209,7 @@ void
AsyncInputStream::AppendToBuffer(const void *data, size_t append_size) noexcept
{
auto w = buffer.Write();
- assert(!w.IsEmpty());
+ assert(!w.empty());
size_t nbytes = std::min(w.size, append_size);
memcpy(w.data, data, nbytes);
@@ -218,7 +218,7 @@ AsyncInputStream::AppendToBuffer(const void *data, size_t append_size) noexcept
const size_t remaining = append_size - nbytes;
if (remaining > 0) {
w = buffer.Write();
- assert(!w.IsEmpty());
+ assert(!w.empty());
assert(w.size >= remaining);
memcpy(w.data, (const uint8_t *)data + nbytes, remaining);