Fix implementation of iterator#increment in csmmap and csmvector

master
Jun Koyama 2020-05-19 18:35:10 +09:00
parent 3b711b8a80
commit ad93d1370d
No known key found for this signature in database
GPG Key ID: 293EC5417501B537
3 changed files with 12 additions and 10 deletions

View File

@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
* Fix implementation of `iterator#increment` in `csmmap` and `csmvector`.
## [4-r.1] - 2020-01-30 ## [4-r.1] - 2020-01-30
### Added ### Added
@ -20,4 +27,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
* Reformat code using Prettier and ESLint. * Reformat code using Prettier and ESLint.
[Unreleased]: https://github.com/Live2D/CubismWebFramework/compare/4-r.1...HEAD
[4-r.1]: https://github.com/Live2D/CubismWebFramework/compare/ce2585a919ac6e99f64dd468933772c6f1abbcc7...4-r.1 [4-r.1]: https://github.com/Live2D/CubismWebFramework/compare/ce2585a919ac6e99f64dd468933772c6f1abbcc7...4-r.1

View File

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

View File

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