diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2006-11-21 19:30:11 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2006-11-21 19:30:11 +0000 |
| commit | deade7c926b026a3ed8d87f86e41d1e0679e80c3 (patch) | |
| tree | 83ed18b8b04605ddc9de10ebbc40fb67f62731fd /src/deptool.cpp | |
| parent | bug 1500287: Arabic and other RTL text not being shaped correctly (diff) | |
| download | inkscape-deade7c926b026a3ed8d87f86e41d1e0679e80c3.tar.gz inkscape-deade7c926b026a3ed8d87f86e41d1e0679e80c3.zip | |
improve performance
(bzr r1999)
Diffstat (limited to 'src/deptool.cpp')
| -rw-r--r-- | src/deptool.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/deptool.cpp b/src/deptool.cpp index 7abeb8925..044d197ff 100644 --- a/src/deptool.cpp +++ b/src/deptool.cpp @@ -159,10 +159,14 @@ public: std::map<String, FileRec *> files; + bool checked; + private: void init() { + type = UNKNOWN; + checked = false; } void assign(const FileRec &other) @@ -172,6 +176,7 @@ private: baseName = other.baseName; suffix = other.suffix; files = other.files; + checked = other.checked; } }; @@ -353,6 +358,9 @@ private: char *fileBuf; int fileSize; + + static const int readBufLen = 8192; + char readBuf[8193]; }; @@ -792,12 +800,11 @@ bool DepTool::scanFile(const String &fname, FileRec *frec) return false; } String buf; - while (true) + while (!feof(f)) { - int ch = fgetc(f); - if (ch < 0) - break; - buf.push_back((char)ch); + int len = fread(readBuf, 1, readBufLen, f); + readBuf[len] = '\0'; + buf.append(readBuf); } fclose(f); |
