tiny patches for minor code cleanup

Everything about development and the OpenMW source code.
Post Reply
capitol
Posts: 7
Joined: 23 Apr 2016, 09:01

tiny patches for minor code cleanup

Post by capitol » 25 Apr 2016, 18:33

Hi

I have started to read through the code, and was wondering if I should write patches for minor code quality things?

Just did this for example:

Code: Select all

diff --git a/apps/esmtool/esmtool.cpp b/apps/esmtool/esmtool.cpp
index be90afe..c6d6ad6 100644
--- a/apps/esmtool/esmtool.cpp
+++ b/apps/esmtool/esmtool.cpp
@@ -442,12 +442,8 @@ int clone(Arguments& info)
     size_t recordCount = info.data.mRecords.size();
 
     int digitCount = 1; // For a nicer output
-    if (recordCount > 9) ++digitCount;
-    if (recordCount > 99) ++digitCount;
-    if (recordCount > 999) ++digitCount;
-    if (recordCount > 9999) ++digitCount;
-    if (recordCount > 99999) ++digitCount;
-    if (recordCount > 999999) ++digitCount;
+    if (recordCount > 0)
+        digitCount = (int)log10(recordCount) + 1;
 
     std::cout << "Loaded " << recordCount << " records:" << std::endl << std::endl;
 
And i also noticed that the .gitignore file could use a few more lines. What is the developer culture of the project, would anyone be willing to review and merge those patches?

User avatar
psi29a
Posts: 4803
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: tiny patches for minor code cleanup

Post by psi29a » 25 Apr 2016, 18:44

Better to just send a pull request on github, let travis-ci run and a developer will review it. :)

You don't have to discuss it here.

Post Reply