Code cleanup and some optimizations#1911
Conversation
|
Also, on that same note. Would you mind making a short list of code style preferences for this project? (please make one for C++ code and one for C#). For example: Naming C++:public variable: braces/indent sample: Class definition order: |
I am not too picky about it to be honest, we should probably go with a consistency style that doesn't cause too many changes to existing code, if it can reasonably match that existing style, I think it would be good, though with Git's support for introducing ignored revisions as not to break blame, maybe changes are not that important. What are you thinking, should we use clang-format maybe? Not sure if we should try to match LLVM/Clang coding style, or keep it more close to C# conventions maybe? |
|
Yeah I was thinking clang-format |
|
Also, I know this doesn't compile. The reason is that there is a mismatch in the c# and CLI bindings for I was looking at implementing it as a simple type map with a getter/setter pair like this: get {
for (uint i = 0; i < <ProperyName>Count; ++i)
yield return Get<ProperyName>(i);
}
set {
Clear<ProperyName>();
foreach (var __x in value)
Add<ProperyName>(__x);
}But the source generator is giving me some problems with the implementation. For example it's now generating a private field which should not be there. |
90d3b86 to
36ef9ad
Compare
36ef9ad to
427c9b0
Compare
|
@tritao Got this working, so just wanted to let you know it's ready for review. (No pressure :p) |
|
Looks great, thanks for much needed cleanups 👍 |
Sorry for the large amount of changes. Though I made sure this PR only contains simple changes and some fixes/optimizations (like adding
const&and usingTryGetValueetc.) so this commit should have no breaking changes.One change that could be breaking is the removal of the
using namespace CppSharp::CppParser::ASTfrom one of the header files, but I really don't think it should be there since it then leaks into other translation units.