jenkins-bot has submitted this change and it was merged.

Change subject: Refactoring: remove underscore prefixes from identifiers
......................................................................


Refactoring: remove underscore prefixes from identifiers

Change-Id: I8c76c32678efe2b6237b2df6122187cd3a7d754f
---
M DiffEngine.h
1 file changed, 21 insertions(+), 21 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/DiffEngine.h b/DiffEngine.h
index 646bb08..1f92f9f 100644
--- a/DiffEngine.h
+++ b/DiffEngine.h
@@ -91,7 +91,7 @@
  */
 
 template<typename T>
-class _DiffEngine
+class DiffEngine
 {
        public:
                // Vectors
@@ -116,16 +116,16 @@
                typedef std::set<T, std::less<T>, WD2_ALLOCATOR<T> > ValueSet;
 #endif
 
-               _DiffEngine() : done(false) {}
+               DiffEngine() : done(false) {}
                void clear();
                void diff (const ValueVector & from_lines,
                                const ValueVector & to_lines, Diff<T> & diff);
-               int _lcs_pos (int ypos);
-               void _compareseq (int xoff, int xlim, int yoff, int ylim);
-               void _shift_boundaries (const ValueVector & lines, BoolVector & 
changed,
+               int lcs_pos (int ypos);
+               void compareseq (int xoff, int xlim, int yoff, int ylim);
+               void shift_boundaries (const ValueVector & lines, BoolVector & 
changed,
                                const BoolVector & other_changed);
        protected:
-               int _diag (int xoff, int xlim, int yoff, int ylim, int nchunks,
+               int diag (int xoff, int xlim, int yoff, int ylim, int nchunks,
                                IntPairVector & seps);
 
                BoolVector xchanged, ychanged;
@@ -139,10 +139,10 @@
 };
 
 //-----------------------------------------------------------------------------
-// _DiffEngine implementation
+// DiffEngine implementation
 //-----------------------------------------------------------------------------
 template<typename T>
-void _DiffEngine<T>::clear()
+void DiffEngine<T>::clear()
 {
        xchanged.clear();
        ychanged.clear();
@@ -156,7 +156,7 @@
 }
 
 template<typename T>
-void _DiffEngine<T>::diff (const ValueVector & from_lines,
+void DiffEngine<T>::diff (const ValueVector & from_lines,
                const ValueVector & to_lines, Diff<T> & diff)
 {
        int n_from = (int)from_lines.size();
@@ -208,11 +208,11 @@
        }
 
        // Find the LCS.
-       _compareseq(0, xv.size(), 0, yv.size());
+       compareseq(0, xv.size(), 0, yv.size());
 
        // Merge edits when possible
-       _shift_boundaries(from_lines, xchanged, ychanged);
-       _shift_boundaries(to_lines, ychanged, xchanged);
+       shift_boundaries(from_lines, xchanged, ychanged);
+       shift_boundaries(to_lines, ychanged, xchanged);
 
        // Compute the edit operations.
        xi = yi = 0;
@@ -271,7 +271,7 @@
  * of the portions it is going to specify.
  */
 template <typename T>
-int _DiffEngine<T>::_diag (int xoff, int xlim, int yoff, int ylim, int nchunks,
+int DiffEngine<T>::diag (int xoff, int xlim, int yoff, int ylim, int nchunks,
                IntPairVector & seps)
 {
        using std::swap;
@@ -328,7 +328,7 @@
 
                        for (y = pMatches->begin(); y != pMatches->end(); ++y) {
                                if (!in_seq.count(*y)) {
-                                       k = _lcs_pos(*y);
+                                       k = lcs_pos(*y);
                                        assert(k > 0);
                                        copy(ymids.begin() + (k-1) * nchunks, 
ymids.begin() + k * nchunks,
                                                        ymids.begin() + k * 
nchunks);
@@ -345,7 +345,7 @@
                                        seq[k] = *y;
                                        in_seq.insert(*y);
                                } else if (!in_seq.count(*y)) {
-                                       k = _lcs_pos(*y);
+                                       k = lcs_pos(*y);
                                        assert(k > 0);
                                        copy(ymids.begin() + (k-1) * nchunks, 
ymids.begin() + k * nchunks,
                                                        ymids.begin() + k * 
nchunks);
@@ -369,7 +369,7 @@
 }
 
 template <typename T>
-int _DiffEngine<T>::_lcs_pos (int ypos) {
+int DiffEngine<T>::lcs_pos (int ypos) {
        int end = lcs;
        if (end == 0 || ypos > seq[end]) {
                seq[++lcs] = ypos;
@@ -406,7 +406,7 @@
  * All line numbers are origin-0 and discarded lines are not counted.
  */
 template <typename T>
-void _DiffEngine<T>::_compareseq (int xoff, int xlim, int yoff, int ylim) {
+void DiffEngine<T>::compareseq (int xoff, int xlim, int yoff, int ylim) {
        using std::pair;
 
        IntPairVector seps;
@@ -431,7 +431,7 @@
                //nchunks = sqrt(min(xlim - xoff, ylim - yoff) / 2.5);
                //nchunks = max(2,min(8,(int)nchunks));
                int nchunks = std::min(MAX_CHUNKS-1, std::min(xlim - xoff, ylim 
- yoff)) + 1;
-               lcs = _diag(xoff, xlim, yoff, ylim, nchunks, seps);
+               lcs = diag(xoff, xlim, yoff, ylim, nchunks, seps);
        }
 
        if (lcs == 0) {
@@ -446,7 +446,7 @@
                IntPairVector::iterator pt1, pt2;
                pt1 = pt2 = seps.begin();
                while (++pt2 != seps.end()) {
-                       _compareseq (pt1->first, pt2->first, pt1->second, 
pt2->second);
+                       compareseq (pt1->first, pt2->first, pt1->second, 
pt2->second);
                        pt1 = pt2;
                }
        }
@@ -465,7 +465,7 @@
  * This is extracted verbatim from analyze.c (GNU diffutils-2.7).
  */
 template <typename T>
-void _DiffEngine<T>::_shift_boundaries (const ValueVector & lines, BoolVector 
& changed,
+void DiffEngine<T>::shift_boundaries (const ValueVector & lines, BoolVector & 
changed,
                const BoolVector & other_changed)
 {
        int i = 0;
@@ -573,7 +573,7 @@
 template<typename T>
 Diff<T>::Diff(const ValueVector & from_lines, const ValueVector & to_lines)
 {
-       _DiffEngine<T> engine;
+       DiffEngine<T> engine;
        engine.diff(from_lines, to_lines, *this);
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/296481
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I8c76c32678efe2b6237b2df6122187cd3a7d754f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/php/wikidiff2
Gerrit-Branch: master
Gerrit-Owner: MaxSem <maxsem.w...@gmail.com>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to