[sword-devel] Difference of linkEntry() method between RawCom and RawCom4 classes

Jaak Ristioja jaak at ristioja.ee
Mon Apr 16 15:13:44 MST 2018


Hello!

In yet another effort to deduplicate some code in Sword++, I stumbled
upon the following difference between the RawCom and RawCom4 classes:

-void RawCom::linkEntry(const SWKey *inkey) {
+void RawCom4::linkEntry(const SWKey *inkey) {
        VerseKey *destkey = &getVerseKey();
        const VerseKey *srckey = &getVerseKey(inkey);
-
        doLinkEntry(destkey->getTestament(),
destkey->getTestamentIndex(), srckey->getTestamentIndex());
-
-       if (inkey != srckey) // free our key if we created a VerseKey
-               delete srckey;
 }

The latter two lines were deleted by SVN 2324:

commit ab64c410a8b452f57df21ff696dfc1bc9f3a84ba
Author: scribe <scribe at bcd7d363-81e1-0310-97ec-a550e20fc99c>
Date:   Mon Apr 20 18:40:15 2009 +0000

    Pushed VerseKey::positionFrom down to SWKey::positionFrom
    modified SWKey::operator = to call positionFrom
    Removed some standalone VerseKey logic making more v11n aware.
    Cleaned up some extraneous files.

    git-svn-id: https://crosswire.org/svn/sword/trunk@2324
bcd7d363-81e1-0310-97ec-a550e20fc99c

It seems that this commit modified both RawCom and RawCom4 in a similar
manner, except that it also removed the two lines in RawCom4.

Please correct me if I'm wrong, but this seems like an oversight, and
those two lines should have been deleted in RawCom::linkEntry() as well?
Thanks!


Best regards,
J



More information about the sword-devel mailing list