community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1864302 - in /comdev/reporter.apache.org/trunk/site/wizard/js: source/generators.js wizard.js
Date Sat, 03 Aug 2019 04:32:43 GMT
Author: humbedooh
Date: Sat Aug  3 04:32:43 2019
New Revision: 1864302

URL: http://svn.apache.org/viewvc?rev=1864302&view=rev
Log:
simplify/enhance ratio condenser

Modified:
    comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
    comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js?rev=1864302&r1=1864301&r2=1864302&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/source/generators.js Sat Aug  3 04:32:43
2019
@@ -40,11 +40,10 @@ function generate_pmc_roster(pdata) {
     x1 = Math.round(x1)
     x2 = Math.round(x2)
     
-    while ((x1/x2) == Math.floor(x1/x2) && x2 > 1) {
-        let k = (x1/x2)
-        x1 /= k
-        x2 /= k
-    }
+    let k = gcd(x1, x2);
+    x1 /= k;
+    x2 /= k;
+    
     
     txt += "There are currently %u committers and %u PMC members in this project.\nThe Committer-to-PMC
ratio is %u:%u.\n\n".format(no_com, no_pmc, x1, x2);
     

Modified: comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js?rev=1864302&r1=1864301&r2=1864302&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js (original)
+++ comdev/reporter.apache.org/trunk/site/wizard/js/wizard.js Sat Aug  3 04:32:43 2019
@@ -1209,11 +1209,10 @@ function generate_pmc_roster(pdata) {
     x1 = Math.round(x1)
     x2 = Math.round(x2)
     
-    while ((x1/x2) == Math.floor(x1/x2) && x2 > 1) {
-        let k = (x1/x2)
-        x1 /= k
-        x2 /= k
-    }
+    let k = gcd(x1, x2);
+    x1 /= k;
+    x2 /= k;
+    
     
     txt += "There are currently %u committers and %u PMC members in this project.\nThe Committer-to-PMC
ratio is %u:%u.\n\n".format(no_com, no_pmc, x1, x2);
     



Mime
View raw message