From 00d40215e2bd2ba52106791b0bc3bea454b6c749 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Wed, 11 Jan 2012 12:31:00 -0600 Subject: [PATCH] are clear() and resize(0) different? --- src/messages/data.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/messages/data.cpp b/src/messages/data.cpp index 4df1674288..f6fb9cdf6d 100644 --- a/src/messages/data.cpp +++ b/src/messages/data.cpp @@ -103,8 +103,8 @@ void data::process_character(unsigned char c) { void data::reset(frame::opcode::value opcode) { m_opcode = opcode; - m_masking_index = M_NOT_MASKED; // -1 indicates do not mask/unmask - m_payload.resize(0); + m_masking_index = M_NOT_MASKED; + m_payload.clear(); m_validator.reset(); m_prepared = false; } @@ -131,7 +131,6 @@ void data::validate_payload() { void data::set_masking_key(int32_t key) { *reinterpret_cast(m_masking_key) = key; - // -2 indicates a masked frame whose key is zero. m_masking_index = (key == 0 ? M_MASK_KEY_ZERO : M_BYTE_0); }