Details

    Description

      Acceptance criterion:

      1. all existing tests still pass
      2. the following new tests don't fail:
      {
          constexpr auto table = qOffsetStringArray("Foo", "oo", "");
          QVERIFY(table.viewAt(0) == "Foo");
          QVERIFY(table.viewAt(1) == "oo");
          QVERIFY(table.viewAt(2) == "");
          QCOMPARE(table.m_string.size(), 4);
      }
      {
          constexpr auto table = qOffsetStringArray("oo", "", "Foo");
          QVERIFY(table.viewAt(0) == "oo");
          QVERIFY(table.viewAt(1) == "");
          QVERIFY(table.viewAt(2) == "Foo");
          QCOMPARE(table.m_string.size(), 4);
      }
      {
          constexpr auto table = qOffsetStringArray("Foo", "Zoo", "oo", "");
          QVERIFY(table.viewAt(0) == "Foo");
          QVERIFY(table.viewAt(1) == "Zoo");
          QVERIFY(table.viewAt(2) == "oo");
          QVERIFY(table.viewAt(3) == "");
          QCOMPARE(table.m_string.size(), 8);
      }
      {
          constexpr auto table = qOffsetStringArray("oo", "", "Zoo", "Foo");
          QVERIFY(table.viewAt(0) == "oo");
          QVERIFY(table.viewAt(1) == "");
          QVERIFY(table.viewAt(2) == "Zoo");
          QVERIFY(table.viewAt(3) == "Foo");
          QCOMPARE(table.m_string.size(), 8);
      }
      

      To maintain prefetcher-friendliness, it would be desirable if the string data would not have to be re-arranged, except when a later longer string replaces an existing earlier suffix of it. That is, qOffsetStringArray("a", "ba", "dba", "aba").m_strings == "dba\0aba", not == "aba\0dba", reeking of a sorting artifact.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cnn Qt Core & Network
            mmutz Marc Mutz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes