Commit 90808b8c authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark Committed by Kurt Hindenburg

Minor performance increase when receiving characters

zmodem up/download loop changes

part of !211
parent f4bc91f1
......@@ -236,24 +236,20 @@ void Emulation::receiveData(const char *text, int length)
{
bufferedUpdate();
QVector<uint> unicodeText = _decoder->toUnicode(text, length).toUcs4();
//send characters to terminal emulator
for (auto &&i : unicodeText) {
for (const uint i : _decoder->toUnicode(text, length).toUcs4()) {
receiveChar(i);
}
//look for z-modem indicator
//-- someone who understands more about z-modems that I do may be able to move
//this check into the above for loop?
for (int i = 0; i < length; i++) {
for (int i = 0; i < length - 4; i++) {
if (text[i] == '\030') {
if (length - i - 1 > 3) {
if (qstrncmp(text + i + 1, "B00", 3) == 0) {
emit zmodemDownloadDetected();
} else if (qstrncmp(text + i + 1, "B01", 3) == 0) {
emit zmodemUploadDetected();
}
if (qstrncmp(text + i + 1, "B00", 3) == 0) {
emit zmodemDownloadDetected();
} else if (qstrncmp(text + i + 1, "B01", 3) == 0) {
emit zmodemUploadDetected();
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment