diff options
Diffstat (limited to 'dom/canvas/WebGLQueueParamTraits.h')
-rw-r--r-- | dom/canvas/WebGLQueueParamTraits.h | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/dom/canvas/WebGLQueueParamTraits.h b/dom/canvas/WebGLQueueParamTraits.h index 3c130c4da6..ccb3e423ed 100644 --- a/dom/canvas/WebGLQueueParamTraits.h +++ b/dom/canvas/WebGLQueueParamTraits.h @@ -123,15 +123,10 @@ struct QueueParamTraits<RawBuffer<T>> { const auto& elemCount = in.size(); auto status = view.WriteParam(elemCount); if (!status) return status; - if (!elemCount) return status; - - const auto& begin = in.begin(); - const bool hasData = static_cast<bool>(begin); - status = view.WriteParam(hasData); - if (!status) return status; - if (!hasData) return status; + if (!elemCount) return status; status = view.WriteFromRange(in.Data()); + return status; } @@ -140,20 +135,12 @@ struct QueueParamTraits<RawBuffer<T>> { size_t elemCount = 0; auto status = view.ReadParam(&elemCount); if (!status) return status; + if (!elemCount) { *out = {}; return true; } - uint8_t hasData = 0; - status = view.ReadParam(&hasData); - if (!status) return status; - if (!hasData) { - auto temp = RawBuffer<T>{elemCount}; - *out = std::move(temp); - return true; - } - auto data = view.template ReadRange<T>(elemCount); if (!data) return false; *out = std::move(RawBuffer<T>{*data}); |