Bug 1305422 - part 11 - don't call size_forward in nsXPCOMStrings.cpp; r=erahm

This commit is contained in:
Nathan Froyd 2016-09-29 22:33:57 -04:00
parent b6a306d931
commit 9131b203eb

View File

@ -83,10 +83,8 @@ NS_StringGetData(const nsAString& aStr, const char16_t** aData,
*aTerminated = aStr.IsTerminated(); *aTerminated = aStr.IsTerminated();
} }
nsAString::const_iterator begin; *aData = aStr.BeginReading();
aStr.BeginReading(begin); return aStr.Length();
*aData = begin.get();
return begin.size_forward();
} }
XPCOM_API(uint32_t) XPCOM_API(uint32_t)
@ -101,10 +99,8 @@ NS_StringGetMutableData(nsAString& aStr, uint32_t aDataLength,
} }
} }
nsAString::iterator begin; *aData = aStr.BeginWriting();
aStr.BeginWriting(begin); return aStr.Length();
*aData = begin.get();
return begin.size_forward();
} }
XPCOM_API(char16_t*) XPCOM_API(char16_t*)
@ -242,10 +238,8 @@ NS_CStringGetData(const nsACString& aStr, const char** aData,
*aTerminated = aStr.IsTerminated(); *aTerminated = aStr.IsTerminated();
} }
nsACString::const_iterator begin; *aData = aStr.BeginReading();
aStr.BeginReading(begin); return aStr.Length();
*aData = begin.get();
return begin.size_forward();
} }
XPCOM_API(uint32_t) XPCOM_API(uint32_t)
@ -259,10 +253,8 @@ NS_CStringGetMutableData(nsACString& aStr, uint32_t aDataLength, char** aData)
} }
} }
nsACString::iterator begin; *aData = aStr.BeginWriting();
aStr.BeginWriting(begin); return aStr.Length();
*aData = begin.get();
return begin.size_forward();
} }
XPCOM_API(char*) XPCOM_API(char*)