Deduplicate offset calculation in QMetaObjectBuilder
Not even an optimization (unless your compiler sucks). Just improves
readability, since offset is already calculated few lines above.
Offset formula used to be somewhat more complicated, but since commit
e58b44d557 it became reusable here.
Change-Id: I4128b2643daf2cb112c9b861342fd0e27c9a1a95
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
parent
b095d26878
commit
e4fd86d53a
|
|
@ -1119,7 +1119,7 @@ static void writeString(char *out, int i, const QByteArray &str,
|
|||
memcpy(out + 2 * i * sizeof(uint), &offsetLen, 2 * sizeof(uint));
|
||||
|
||||
memcpy(out + offset, str.constData(), size);
|
||||
out[offsetOfStringdataMember + stringdataOffset + size] = '\0';
|
||||
out[offset + size] = '\0';
|
||||
|
||||
stringdataOffset += size + 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue