common: kit: test: wsd: make isKitInProcess constexpr#15663
Closed
aregnak wants to merge 3 commits intoCollaboraOnline:mainfrom
Closed
common: kit: test: wsd: make isKitInProcess constexpr#15663aregnak wants to merge 3 commits intoCollaboraOnline:mainfrom
aregnak wants to merge 3 commits intoCollaboraOnline:mainfrom
Conversation
The setKitInProcess function was only called with the true argument in coolwsd-inproc.cpp, which is only compiled when ENABLE_DEBUG is true. Similarly, setKitInProcess was always called with false argument from coolwsd-fork.cpp. Since these are compile time invariants, create ENABLE_INPROC compiler directive when ENABLE_DEBUG is true in Makefile.am, and convert isKitInProcess into a constexpr function that returns true if ENABLE_INPROC, and simplify its implementation. Also, remove setKitInProcess and kitInProcess. Signed-off-by: Areg Nakashian <areg.nakashian@gmail.com> Change-Id: Ic1744cad1c3d06bacba4298daa9132ac5bb9c892
Signed-off-by: Areg Nakashian <areg.nakashian@gmail.com> Change-Id: Icdff5fe5534dc14df2c9955a45794fa65090793d
Signed-off-by: Areg Nakashian <areg.nakashian@gmail.com> Change-Id: I303524d9c2b4b12fba06e3bbbd64eb052f45dbdd
|
Thank you for your contribution! However, the main branch on GitHub is not used for this project. Please submit patches to the main branch of the online repo at https://gerrit.collaboraoffice.com. See CONTRIBUTING.md for details. This PR has been automatically closed. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The
setKitInProcessfunction was only called with the true argumentin
coolwsd-inproc.cpp, which is only compiled whenENABLE_DEBUGis true.Similarly,
setKitInProcesswas always called with false argument fromcoolwsd-fork.cpp.Since these are compile time invariants, create
ENABLE_INPROCcompilerdirective when
ENABLE_DEBUGis true inMakefile.am, and convertisKitInProcessinto a constexpr function that returns true if
ENABLE_INPROC, and simplify itsimplementation.
Also, remove
setKitInProcessandkitInProcess, and convert all conditionalson
isKitInProcessconstexpr where applicable.Checklist
make prettier-writeand formatted the code.make checkmake runand manually verified that everything looks okay