Some performance improvements.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@469 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a8f767802f
commit
433938e2bf
1 changed files with 13 additions and 0 deletions
|
|
@ -560,11 +560,17 @@ DohTell(DOH *obj) {
|
||||||
|
|
||||||
int
|
int
|
||||||
DohGetc(DOH *obj) {
|
DohGetc(DOH *obj) {
|
||||||
|
static DOH *lastdoh = 0;
|
||||||
DohBase *b = (DohBase *) obj;
|
DohBase *b = (DohBase *) obj;
|
||||||
DohObjInfo *objinfo;
|
DohObjInfo *objinfo;
|
||||||
|
if (obj == lastdoh) {
|
||||||
|
objinfo = dohtypes[b->type];
|
||||||
|
return (objinfo->doh_file->doh_getc)(b);
|
||||||
|
}
|
||||||
if (DohCheck(obj)) {
|
if (DohCheck(obj)) {
|
||||||
objinfo = dohtypes[b->type];
|
objinfo = dohtypes[b->type];
|
||||||
if (objinfo->doh_file->doh_getc) {
|
if (objinfo->doh_file->doh_getc) {
|
||||||
|
lastdoh = obj;
|
||||||
return (objinfo->doh_file->doh_getc)(b);
|
return (objinfo->doh_file->doh_getc)(b);
|
||||||
}
|
}
|
||||||
return EOF;
|
return EOF;
|
||||||
|
|
@ -578,11 +584,18 @@ DohGetc(DOH *obj) {
|
||||||
|
|
||||||
int
|
int
|
||||||
DohPutc(int ch, DOH *obj) {
|
DohPutc(int ch, DOH *obj) {
|
||||||
|
static DOH *lastdoh = 0;
|
||||||
DohBase *b = (DohBase *) obj;
|
DohBase *b = (DohBase *) obj;
|
||||||
DohObjInfo *objinfo;
|
DohObjInfo *objinfo;
|
||||||
|
|
||||||
|
if (obj == lastdoh) {
|
||||||
|
objinfo = dohtypes[b->type];
|
||||||
|
return (objinfo->doh_file->doh_putc)(b,ch);
|
||||||
|
}
|
||||||
if (DohCheck(obj)) {
|
if (DohCheck(obj)) {
|
||||||
objinfo = dohtypes[b->type];
|
objinfo = dohtypes[b->type];
|
||||||
if (objinfo->doh_file->doh_putc) {
|
if (objinfo->doh_file->doh_putc) {
|
||||||
|
lastdoh = obj;
|
||||||
return (objinfo->doh_file->doh_putc)(b,ch);
|
return (objinfo->doh_file->doh_putc)(b,ch);
|
||||||
}
|
}
|
||||||
return EOF;
|
return EOF;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue