Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/Utils.cpp

Issue 29409580: Issue 5013 - Make parameter const ref when applicable. (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Created April 11, 2017, 1:58 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/Utils.cpp
===================================================================
--- a/src/Utils.cpp
+++ b/src/Utils.cpp
@@ -22,24 +22,24 @@
#include <Windows.h>
#include <Shlwapi.h>
#endif
#include "Utils.h"
using namespace AdblockPlus;
-std::string Utils::Slurp(std::istream& stream)
+std::string Utils::Slurp(const std::istream& stream)
sergei 2017/04/12 13:34:30 I would like to avoid having const here because we
{
std::stringstream content;
content << stream.rdbuf();
return content.str();
}
-std::string Utils::FromV8String(v8::Handle<v8::Value> value)
+std::string Utils::FromV8String(const v8::Handle<v8::Value>& value)
sergei 2017/04/12 13:34:30 I'm not sure that v8::Handle should be passed by r
sergei 2017/04/18 14:02:14 What about it?
hub 2017/04/18 16:18:50 I thought I had replied to this one. My take is th
{
v8::String::Utf8Value stringValue(value);
if (stringValue.length())
return std::string(*stringValue, stringValue.length());
else
return std::string();
}
« include/AdblockPlus/JsEngine.h ('K') | « src/Utils.h ('k') | src/WebRequestJsObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld