From 649de6a211a65af37f6084136ccd157ef2df9822 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Mon, 8 Jun 2009 16:42:06 +0200 Subject: [PATCH] CopyData is more efficient than a PeekData+memcpy pair --- src/node/socket.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/socket.cc b/src/node/socket.cc index e13dcf43e..093c501d7 100644 --- a/src/node/socket.cc +++ b/src/node/socket.cc @@ -148,7 +148,7 @@ Socket::Recv (uint8_t* buf, uint32_t size, uint32_t flags) { return 0; } - memcpy (buf, p->PeekData (), p->GetSize()); + p->CopyData (buf, p->GetSize ()); return p->GetSize (); } @@ -169,7 +169,7 @@ Socket::RecvFrom (uint8_t* buf, uint32_t size, uint32_t flags, { return 0; } - memcpy (buf, p->PeekData (), p->GetSize()); + p->CopyData (buf, p->GetSize ()); return p->GetSize (); }