Skip to content

Obsolete bool value in IMEManager::Update_Candidate_List #1083

@xezon

Description

@xezon
void IMEManager::Update_Candidate_List(int candidate_flags)
{
...
                    if (list != nullptr) {
                        memset(list, 0, size);
                        bool b2 = true;
                        DWORD size2;

                        if (is_unicode) {
                            size2 = ImmGetCandidateListW(m_context, index, list, size);
                        } else {
                            size2 = ImmGetCandidateListA(m_context, index, list, size);
                        }

                        if (size2 == 0 || size2 > size) {
                            captainslog_dbgassert(size2 < size, "IME candidate buffer overrun");
                            b2 = false;
                        }

                        if (b2 && list->dwStyle && list->dwStyle != IME_CAND_CODE) {
                            if (list->dwPageStart > list->dwSelection
                                || list->dwSelection >= list->dwPageSize + list->dwPageStart) {
                                list->dwPageStart = list->dwPageSize * (list->dwSelection / list->dwPageSize);
                            }
...

b2 can be removed by using else if, making code simpler.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions