From 4ac0ccc06ce0cafea2549f51881cba0c44463d9c Mon Sep 17 00:00:00 2001 From: om Date: Thu, 9 Mar 2006 21:58:54 +0000 Subject: Convert more by-values to const references, optimise ConfigReader a bit git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3606 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socket.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/socket.cpp') diff --git a/src/socket.cpp b/src/socket.cpp index 923ca5848..d4cdb0a18 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -59,10 +59,9 @@ InspSocket::InspSocket(int newfd, char* ip) socket_ref[this->fd] = this; } -InspSocket::InspSocket(std::string ahost, int aport, bool listening, unsigned long maxtime) +InspSocket::InspSocket(const std::string &ahost, int aport, bool listening, unsigned long maxtime) + : fd(-1), host(ahost) { - this->fd = -1; - this->host = ahost; this->outbuffer.clear(); if (listening) { if ((this->fd = OpenTCPSocket()) == ERROR) @@ -242,7 +241,7 @@ char* InspSocket::Read() // It will either write all of the data, or an undefined amount. // If an undefined amount is written the connection has failed // and should be aborted. -int InspSocket::Write(std::string data) +int InspSocket::Write(const std::string &data) { /* Try and append the data to the back of the queue, and send it on its way */ @@ -372,4 +371,3 @@ InspSocket::~InspSocket() { this->Close(); } - -- cgit v1.2.3