Fix implementation of iterator#increment in csmmap and csmvector

This commit is contained in:
Jun Koyama
2020-05-19 18:35:10 +09:00
parent 3b711b8a80
commit ad93d1370d
3 changed files with 12 additions and 10 deletions

View File

@ -272,9 +272,7 @@ export namespace Live2DCubismFramework {
*/
public increment(): iterator<_KeyT, _ValT> {
const iteold = new iterator<_KeyT, _ValT>(this._map, this._index++); // 古い値を保存
this._map = iteold._map;
this._index = iteold._index;
return this;
return iteold;
}
/**

View File

@ -303,10 +303,8 @@ export namespace Live2DCubismFramework {
* 後置き++演算子
*/
public increment(): iterator<T> {
const iteold = new iterator<T>(this._vector, this._index++);
this._vector = iteold._vector;
this._index = iteold._index;
return this;
const iteold = new iterator<T>(this._vector, this._index++); // 古い値を保存
return iteold;
}
/**
@ -314,9 +312,7 @@ export namespace Live2DCubismFramework {
*/
public decrement(): iterator<T> {
const iteold = new iterator<T>(this._vector, this._index--); // 古い値を保存
this._vector = iteold._vector;
this._index = iteold._index;
return this;
return iteold;
}
/**