Bug 1492272 - Get rid of Begin/EndWriting(iterator&) string functions. r=froydnj

This removes the rarely used and somewhat odd
`iterator& BeginWriting/EndWriting(iterator&)` functions that take an iterator
as an in/out param and then return it.

--HG--
extra : rebase_source : 92066f996595e9b7df9642813c08592cee47c630
This commit is contained in:
Eric Rahm 2018-09-18 13:35:09 -07:00
parent 2fb6934934
commit 513dbaad87
3 changed files with 3 additions and 26 deletions

View File

@ -781,8 +781,7 @@ nsStandardURL::BuildNormalizedSpec(const char *spec,
// approxLen should be correct or 1 high
if (!mSpec.SetLength(approxLen+1, fallible)) // buf needs a trailing '\0' below
return NS_ERROR_OUT_OF_MEMORY;
char *buf;
mSpec.BeginWriting(buf);
char *buf = mSpec.BeginWriting();
uint32_t i = 0;
int32_t diff = 0;

View File

@ -220,10 +220,8 @@ nsLocalFile::GetRelativeDescriptor(nsIFile* aFromFile, nsACString& aResult)
}
// get raw pointer to mutable string buffer
char16_t* thisPathPtr;
thisPath.BeginWriting(thisPathPtr);
char16_t* fromPathPtr;
fromPath.BeginWriting(fromPathPtr);
char16_t* thisPathPtr = thisPath.BeginWriting();
char16_t* fromPathPtr = fromPath.BeginWriting();
SplitPath(thisPathPtr, thisNodes);
SplitPath(fromPathPtr, fromNodes);

View File

@ -393,26 +393,6 @@ public:
return EnsureMutable() ? (base_string_type::mData + base_string_type::mLength) : iterator(0);
}
iterator& BeginWriting(iterator& aIter)
{
return aIter = BeginWriting();
}
iterator& BeginWriting(iterator& aIter, const fallible_t& aFallible)
{
return aIter = BeginWriting(aFallible);
}
iterator& EndWriting(iterator& aIter)
{
return aIter = EndWriting();
}
iterator& EndWriting(iterator& aIter, const fallible_t& aFallible)
{
return aIter = EndWriting(aFallible);
}
/**
* Perform string to int conversion.
* @param aErrorCode will contain error if one occurs