-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
アウトライン解析ウィンドウのツリービューの設定処理の高速化 #1648
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
結局、引数を増やすんです?
「引数を渡さないのは非効率なのは自明」だけど、実害は出てないと理解しました。
紛らわしいので引数追加はrevert(と同じになるようにコミットを積む)が良さそうに思います。
目下、自分が気にしているのはあとココだけです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
引数を増やさないで同じ処理を行うとなると下記の手段が考えられます。
CDlgFuncList
クラスにメンバー変数HTREEITEM m_hInsertAfter
を追加してそれ経由で情報を渡すSetTree
とSetTreeJava
でm_nSortType
の値を元にhInsertAfter
ローカル変数を初期化する記述を重複して書く関連する実装について説明します。
hInsertAfter
引数はSetTree
やSetTreeJava
の中で呼び出すTreeView_InsertItem
マクロの第2引数に渡されるTV_INSERTSTRUCT
構造体のhInsertAfter
メンバーに設定しています。元の実装では
SetTree
ではTVI_FIRST
がTV_INSERTSTRUCT::hInsertAfter
に設定されていました。そしてSetTreeJava
ではTVI_LAST
がTV_INSERTSTRUCT::hInsertAfter
に設定されていました。このPRの実装では
m_nSortType
の値によってTVI_FIRST
とTVI_LAST
のどちらを設定するかを変える事で、後でSortTree
の呼び出しを省けようにしています。なおSortTree
の呼び出しを省いているのは順序がデフォルト
とデフォルト(降順)
の場合のみです。それらについてはツリービューへの追加順序を調整すれば後でソートしないでも問題ないだろうと判断しました。https://docs.microsoft.com/en-us/windows/win32/api/commctrl/ns-commctrl-tvinsertstructa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ちょっと分からなかったのですが「PRの実現に必要な変更」なのであれば、そう言って貰えれば良いです。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
どちらかというと必要な変更だと思ってます。こうする事で SortTree の呼び出しを省いて高速化できるので。