diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libtqtrla/src/tqtrla.cpp | 50 |
1 files changed, 4 insertions, 46 deletions
diff --git a/lib/libtqtrla/src/tqtrla.cpp b/lib/libtqtrla/src/tqtrla.cpp index b3fc1ec..711804e 100644 --- a/lib/libtqtrla/src/tqtrla.cpp +++ b/lib/libtqtrla/src/tqtrla.cpp @@ -326,30 +326,9 @@ TQDataStream &operator<<( TQDataStream &s, const TQFloatArray &data ) { TQ_UINT32 i; TQ_UINT32 count = data.count(); s << count; - - TQIODevice* dev = s.device(); - if (dev) { - // This uses the channel efficiently by writing all the data in one large block - TQBuffer ba; - ba.open(IO_ReadWrite); - TQDataStream ds(&ba); - ds.setPrintableData(s.isPrintableData()); - - for (i=0; i<count; i++) { - ds << data[i]; - } - - ba.close(); - TQByteArray buffer = ba.buffer(); - dev->writeBlock(buffer.data(), buffer.size()); - } - else { - // This uses the channel inefficiently by writing the data in byte-sized chunks - for (i=0; i<count; i++) { - s << data[i]; - } + for (i=0; i<count; i++) { + s << data[i]; } - return s; } @@ -368,30 +347,9 @@ TQDataStream &operator<<( TQDataStream &s, const TQDoubleArray &data ) { TQ_UINT32 i; TQ_UINT32 count = data.count(); s << count; - - TQIODevice* dev = s.device(); - if (dev) { - // This uses the channel efficiently by writing all the data in one large block - TQBuffer ba; - ba.open(IO_ReadWrite); - TQDataStream ds(&ba); - ds.setPrintableData(s.isPrintableData()); - - for (i=0; i<count; i++) { - ds << data[i]; - } - - ba.close(); - TQByteArray buffer = ba.buffer(); - dev->writeBlock(buffer.data(), buffer.size()); - } - else { - // This uses the channel inefficiently by writing the data in byte-sized chunks - for (i=0; i<count; i++) { - s << data[i]; - } + for (i=0; i<count; i++) { + s << data[i]; } - return s; } |