This commit is contained in:
Ivan Lezhankin 2021-02-04 22:06:43 +03:00
parent 2b9909d396
commit 84b88c6802
2 changed files with 4 additions and 6 deletions

View File

@ -244,7 +244,7 @@ public:
if (whence == SEEK_CUR) if (whence == SEEK_CUR)
{ {
/// If position within current working buffer - shift pos. /// If position within current working buffer - shift pos.
if (working_buffer.size() && size_t(getPosition() + offset_) < absolute_position) if (!working_buffer.empty() && size_t(getPosition() + offset_) < absolute_position)
{ {
pos += offset_; pos += offset_;
return getPosition(); return getPosition();
@ -257,7 +257,7 @@ public:
else if (whence == SEEK_SET) else if (whence == SEEK_SET)
{ {
/// If position within current working buffer - shift pos. /// If position within current working buffer - shift pos.
if (working_buffer.size() && size_t(offset_) >= absolute_position - working_buffer.size() if (!working_buffer.empty() && size_t(offset_) >= absolute_position - working_buffer.size()
&& size_t(offset_) < absolute_position) && size_t(offset_) < absolute_position)
{ {
pos = working_buffer.end() - (absolute_position - offset_); pos = working_buffer.end() - (absolute_position - offset_);

View File

@ -76,9 +76,7 @@ public:
} }
} }
virtual ~UpdatableSessionBase() virtual ~UpdatableSessionBase() = default;
{
}
}; };
@ -205,7 +203,7 @@ namespace detail
{ {
if (next_callback) if (next_callback)
next_callback(count()); next_callback(count());
if (working_buffer.size()) if (!working_buffer.empty())
impl->position() = position(); impl->position() = position();
if (!impl->next()) if (!impl->next())
return false; return false;