diff --git a/CHANGELOG.md b/CHANGELOG.md index 64c9eac..6b87688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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/). +## [Unreleased] + +### Fixed + +* Fix implementation of `iterator#increment` in `csmmap` and `csmvector`. + + ## [4-r.1] - 2020-01-30 ### 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. +[Unreleased]: https://github.com/Live2D/CubismWebFramework/compare/4-r.1...HEAD [4-r.1]: https://github.com/Live2D/CubismWebFramework/compare/ce2585a919ac6e99f64dd468933772c6f1abbcc7...4-r.1 diff --git a/src/type/csmmap.ts b/src/type/csmmap.ts index 64a4200..31d26ca 100644 --- a/src/type/csmmap.ts +++ b/src/type/csmmap.ts @@ -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; } /** diff --git a/src/type/csmvector.ts b/src/type/csmvector.ts index 4e105a5..a0c3c17 100644 --- a/src/type/csmvector.ts +++ b/src/type/csmvector.ts @@ -303,10 +303,8 @@ export namespace Live2DCubismFramework { * 後置き++演算子 */ public increment(): iterator { - const iteold = new iterator(this._vector, this._index++); - this._vector = iteold._vector; - this._index = iteold._index; - return this; + const iteold = new iterator(this._vector, this._index++); // 古い値を保存 + return iteold; } /** @@ -314,9 +312,7 @@ export namespace Live2DCubismFramework { */ public decrement(): iterator { const iteold = new iterator(this._vector, this._index--); // 古い値を保存 - this._vector = iteold._vector; - this._index = iteold._index; - return this; + return iteold; } /**