mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
String insertion was broken if you wanted to insert at the begining (index '0') of a string.
This commit is contained in:
parent
9756611cdc
commit
e77dfab87e
@ -927,7 +927,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) {
|
||||
*/
|
||||
PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
|
||||
aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given
|
||||
if(0<anOffset) {
|
||||
if(0<=anOffset) {
|
||||
if(aCount>0) {
|
||||
|
||||
//1st optimization: If you're inserting at end, then simply append!
|
||||
|
@ -927,7 +927,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) {
|
||||
*/
|
||||
PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
|
||||
aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given
|
||||
if(0<anOffset) {
|
||||
if(0<=anOffset) {
|
||||
if(aCount>0) {
|
||||
|
||||
//1st optimization: If you're inserting at end, then simply append!
|
||||
|
@ -927,7 +927,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) {
|
||||
*/
|
||||
PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
|
||||
aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given
|
||||
if(0<anOffset) {
|
||||
if(0<=anOffset) {
|
||||
if(aCount>0) {
|
||||
|
||||
//1st optimization: If you're inserting at end, then simply append!
|
||||
|
@ -927,7 +927,7 @@ PRInt32 nsString::Right(nsString& aCopy,PRInt32 aCount) {
|
||||
*/
|
||||
PRInt32 nsString::Insert(nsString& aCopy,PRInt32 anOffset,PRInt32 aCount) {
|
||||
aCount=(aCount>aCopy.mLength) ? aCopy.mLength : aCount; //don't try to copy more than you are given
|
||||
if(0<anOffset) {
|
||||
if(0<=anOffset) {
|
||||
if(aCount>0) {
|
||||
|
||||
//1st optimization: If you're inserting at end, then simply append!
|
||||
|
Loading…
Reference in New Issue
Block a user