Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@orangekame3
お忙しいところ度々失礼いたします!🙇
gtree パッケージの OutputProgrammably func の内部実装を少し変更して、処理回数を減らしました!
なので、ツール利用者からすると若干ですが体感の処理速度ははやくなるかと思います。
変更前
変更後
要は変更前後で余分なループを減らしました!
あと蛇足ですが、もう少し改善できないか考え、gtree パッケージの .Addメソッド呼び出し直後に枝を返せないか検討してみました。
結果、一度ツリーを構成した後でなければ、枝を決定できなさそうと気づきました🙇
ref: ddddddO/gtree#239 (comment)
とは言っても、こちらのツールはprefix指定できるので、利用者からするとさほど問題にはならなそうと思ってます!