mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Replace const Type& with Type const& for common types.
* std::string * RippleAccount * Account * Currency * uint256 * STAmount * Json::Value
This commit is contained in:
committed by
Vinnie Falco
parent
f5afe0587f
commit
648ccc7c17
@@ -127,7 +127,7 @@ Reader::Reader ( const Features& features )
|
||||
|
||||
|
||||
bool
|
||||
Reader::parse ( const std::string& document,
|
||||
Reader::parse ( std::string const& document,
|
||||
Value& root,
|
||||
bool collectComments )
|
||||
{
|
||||
@@ -742,7 +742,7 @@ Reader::decodeDouble( Token &token )
|
||||
return addError( "'" + std::string( token.start_, token.end_ ) + "' is not a number.", token );
|
||||
currentValue() = value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -902,7 +902,7 @@ Reader::decodeUnicodeEscapeSequence ( Token& token,
|
||||
|
||||
|
||||
bool
|
||||
Reader::addError ( const std::string& message,
|
||||
Reader::addError ( std::string const& message,
|
||||
Token& token,
|
||||
Location extra )
|
||||
{
|
||||
@@ -936,7 +936,7 @@ Reader::recoverFromError ( TokenType skipUntilToken )
|
||||
|
||||
|
||||
bool
|
||||
Reader::addErrorAndRecover ( const std::string& message,
|
||||
Reader::addErrorAndRecover ( std::string const& message,
|
||||
Token& token,
|
||||
TokenType skipUntilToken )
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ const UInt Value::maxUInt = UInt (-1);
|
||||
// return 0;
|
||||
//}
|
||||
//
|
||||
//inline char *safeStringDup( const std::string &str )
|
||||
//inline char *safeStringDup( std::string const&str )
|
||||
//{
|
||||
// if ( !str.empty() )
|
||||
// {
|
||||
@@ -380,7 +380,7 @@ Value::Value ( const char* beginValue,
|
||||
}
|
||||
|
||||
|
||||
Value::Value ( const std::string& value )
|
||||
Value::Value ( std::string const& value )
|
||||
: type_ ( stringValue )
|
||||
, allocated_ ( true )
|
||||
, comments_ ( 0 )
|
||||
@@ -1259,14 +1259,14 @@ Value::operator[] ( const char* key ) const
|
||||
|
||||
|
||||
Value&
|
||||
Value::operator[] ( const std::string& key )
|
||||
Value::operator[] ( std::string const& key )
|
||||
{
|
||||
return (*this)[ key.c_str () ];
|
||||
}
|
||||
|
||||
|
||||
const Value&
|
||||
Value::operator[] ( const std::string& key ) const
|
||||
Value::operator[] ( std::string const& key ) const
|
||||
{
|
||||
return (*this)[ key.c_str () ];
|
||||
}
|
||||
@@ -1311,7 +1311,7 @@ Value::get ( const char* key,
|
||||
|
||||
|
||||
Value
|
||||
Value::get ( const std::string& key,
|
||||
Value::get ( std::string const& key,
|
||||
const Value& defaultValue ) const
|
||||
{
|
||||
return get ( key.c_str (), defaultValue );
|
||||
@@ -1353,7 +1353,7 @@ Value::removeMember ( const char* key )
|
||||
}
|
||||
|
||||
Value
|
||||
Value::removeMember ( const std::string& key )
|
||||
Value::removeMember ( std::string const& key )
|
||||
{
|
||||
return removeMember ( key.c_str () );
|
||||
}
|
||||
@@ -1376,7 +1376,7 @@ Value::isMember ( const char* key ) const
|
||||
|
||||
|
||||
bool
|
||||
Value::isMember ( const std::string& key ) const
|
||||
Value::isMember ( std::string const& key ) const
|
||||
{
|
||||
return isMember ( key.c_str () );
|
||||
}
|
||||
@@ -1530,7 +1530,7 @@ Value::setComment ( const char* comment,
|
||||
|
||||
|
||||
void
|
||||
Value::setComment ( const std::string& comment,
|
||||
Value::setComment ( std::string const& comment,
|
||||
CommentPlacement placement )
|
||||
{
|
||||
setComment ( comment.c_str (), placement );
|
||||
@@ -1758,7 +1758,7 @@ PathArgument::PathArgument ( const char* key )
|
||||
}
|
||||
|
||||
|
||||
PathArgument::PathArgument ( const std::string& key )
|
||||
PathArgument::PathArgument ( std::string const& key )
|
||||
: key_ ( key.c_str () )
|
||||
, kind_ ( kindKey )
|
||||
{
|
||||
@@ -1767,7 +1767,7 @@ PathArgument::PathArgument ( const std::string& key )
|
||||
// class Path
|
||||
// //////////////////////////////////////////////////////////////////
|
||||
|
||||
Path::Path ( const std::string& path,
|
||||
Path::Path ( std::string const& path,
|
||||
const PathArgument& a1,
|
||||
const PathArgument& a2,
|
||||
const PathArgument& a3,
|
||||
@@ -1785,7 +1785,7 @@ Path::Path ( const std::string& path,
|
||||
|
||||
|
||||
void
|
||||
Path::makePath ( const std::string& path,
|
||||
Path::makePath ( std::string const& path,
|
||||
const InArgs& in )
|
||||
{
|
||||
const char* current = path.c_str ();
|
||||
@@ -1836,7 +1836,7 @@ Path::makePath ( const std::string& path,
|
||||
|
||||
|
||||
void
|
||||
Path::addPathInArg ( const std::string& path,
|
||||
Path::addPathInArg ( std::string const& path,
|
||||
const InArgs& in,
|
||||
InArgs::const_iterator& itInArg,
|
||||
PathArgument::Kind kind )
|
||||
@@ -1857,7 +1857,7 @@ Path::addPathInArg ( const std::string& path,
|
||||
|
||||
|
||||
void
|
||||
Path::invalidPath ( const std::string& path,
|
||||
Path::invalidPath ( std::string const& path,
|
||||
int location )
|
||||
{
|
||||
// Error: invalid path.
|
||||
|
||||
@@ -90,7 +90,7 @@ std::string valueToString( double value )
|
||||
snprintf(buffer, sizeof(buffer), "%.16g", value);
|
||||
#endif
|
||||
return buffer;
|
||||
}
|
||||
}
|
||||
|
||||
std::string valueToString ( bool value )
|
||||
{
|
||||
@@ -259,7 +259,7 @@ FastWriter::writeValue ( const Value& value )
|
||||
it != members.end ();
|
||||
++it )
|
||||
{
|
||||
const std::string& name = *it;
|
||||
std::string const& name = *it;
|
||||
|
||||
if ( it != members.begin () )
|
||||
document_ += ",";
|
||||
@@ -348,7 +348,7 @@ StyledWriter::writeValue ( const Value& value )
|
||||
|
||||
while ( true )
|
||||
{
|
||||
const std::string& name = *it;
|
||||
std::string const& name = *it;
|
||||
const Value& childValue = value[name];
|
||||
writeCommentBeforeValue ( childValue );
|
||||
writeWithIndent ( valueToQuotedString ( name.c_str () ) );
|
||||
@@ -474,7 +474,7 @@ StyledWriter::isMultineArray ( const Value& value )
|
||||
|
||||
|
||||
void
|
||||
StyledWriter::pushValue ( const std::string& value )
|
||||
StyledWriter::pushValue ( std::string const& value )
|
||||
{
|
||||
if ( addChildValues_ )
|
||||
childValues_.push_back ( value );
|
||||
@@ -502,7 +502,7 @@ StyledWriter::writeIndent ()
|
||||
|
||||
|
||||
void
|
||||
StyledWriter::writeWithIndent ( const std::string& value )
|
||||
StyledWriter::writeWithIndent ( std::string const& value )
|
||||
{
|
||||
writeIndent ();
|
||||
document_ += value;
|
||||
@@ -560,7 +560,7 @@ StyledWriter::hasCommentForValue ( const Value& value )
|
||||
|
||||
|
||||
std::string
|
||||
StyledWriter::normalizeEOL ( const std::string& text )
|
||||
StyledWriter::normalizeEOL ( std::string const& text )
|
||||
{
|
||||
std::string normalized;
|
||||
normalized.reserve ( text.length () );
|
||||
@@ -659,7 +659,7 @@ StyledStreamWriter::writeValue ( const Value& value )
|
||||
|
||||
while ( true )
|
||||
{
|
||||
const std::string& name = *it;
|
||||
std::string const& name = *it;
|
||||
const Value& childValue = value[name];
|
||||
writeCommentBeforeValue ( childValue );
|
||||
writeWithIndent ( valueToQuotedString ( name.c_str () ) );
|
||||
@@ -785,7 +785,7 @@ StyledStreamWriter::isMultineArray ( const Value& value )
|
||||
|
||||
|
||||
void
|
||||
StyledStreamWriter::pushValue ( const std::string& value )
|
||||
StyledStreamWriter::pushValue ( std::string const& value )
|
||||
{
|
||||
if ( addChildValues_ )
|
||||
childValues_.push_back ( value );
|
||||
@@ -814,7 +814,7 @@ StyledStreamWriter::writeIndent ()
|
||||
|
||||
|
||||
void
|
||||
StyledStreamWriter::writeWithIndent ( const std::string& value )
|
||||
StyledStreamWriter::writeWithIndent ( std::string const& value )
|
||||
{
|
||||
writeIndent ();
|
||||
*document_ << value;
|
||||
@@ -872,7 +872,7 @@ StyledStreamWriter::hasCommentForValue ( const Value& value )
|
||||
|
||||
|
||||
std::string
|
||||
StyledStreamWriter::normalizeEOL ( const std::string& text )
|
||||
StyledStreamWriter::normalizeEOL ( std::string const& text )
|
||||
{
|
||||
std::string normalized;
|
||||
normalized.reserve ( text.length () );
|
||||
|
||||
Reference in New Issue
Block a user