diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-10 09:26:16 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2022-02-10 09:26:16 (GMT) |
commit | 8f805cf711937914ecd371343acfe9a4b8f27238 (patch) | |
tree | ae39f8b2d3ef7155cbb47b6e2f33170f38aac9a4 /generic/tclEncoding.c | |
parent | f608eb10d475301aedbbf0d6a0addbd50dea0e34 (diff) | |
download | tcl-8f805cf711937914ecd371343acfe9a4b8f27238.zip tcl-8f805cf711937914ecd371343acfe9a4b8f27238.tar.gz tcl-8f805cf711937914ecd371343acfe9a4b8f27238.tar.bz2 |
Use TclListObjLength/TclListObjGetElements in stead of Tcl_ListObjLength/Tcl_ListObjGetElements everywhere. This is slightly more efficient if the refered list already has the correct type
Diffstat (limited to 'generic/tclEncoding.c')
-rw-r--r-- | generic/tclEncoding.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 4c59bc6..fe2b55b 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -384,7 +384,7 @@ Tcl_SetEncodingSearchPath( { int dummy; - if (TCL_ERROR == Tcl_ListObjLength(NULL, searchPath, &dummy)) { + if (TCL_ERROR == TclListObjLength(NULL, searchPath, &dummy)) { return TCL_ERROR; } TclSetProcessGlobalValue(&encodingSearchPath, searchPath, NULL); @@ -431,7 +431,7 @@ TclSetLibraryPath( { int dummy; - if (TCL_ERROR == Tcl_ListObjLength(NULL, path, &dummy)) { + if (TCL_ERROR == TclListObjLength(NULL, path, &dummy)) { return; } TclSetProcessGlobalValue(&libraryPath, path, NULL); @@ -470,7 +470,7 @@ FillEncodingFileMap(void) searchPath = Tcl_GetEncodingSearchPath(); Tcl_IncrRefCount(searchPath); - Tcl_ListObjLength(NULL, searchPath, &numDirs); + TclListObjLength(NULL, searchPath, &numDirs); map = Tcl_NewDictObj(); Tcl_IncrRefCount(map); @@ -494,7 +494,7 @@ FillEncodingFileMap(void) Tcl_FSMatchInDirectory(NULL, matchFileList, directory, "*.enc", &readableFiles); - Tcl_ListObjGetElements(NULL, matchFileList, &numFiles, &filev); + TclListObjGetElements(NULL, matchFileList, &numFiles, &filev); for (j=0; j<numFiles; j++) { Tcl_Obj *encodingName, *fileObj; @@ -692,7 +692,7 @@ Tcl_GetDefaultEncodingDir(void) int numDirs; Tcl_Obj *first, *searchPath = Tcl_GetEncodingSearchPath(); - Tcl_ListObjLength(NULL, searchPath, &numDirs); + TclListObjLength(NULL, searchPath, &numDirs); if (numDirs == 0) { return NULL; } @@ -1488,7 +1488,7 @@ OpenEncodingFileChannel( Tcl_Channel chan = NULL; int i, numDirs; - Tcl_ListObjGetElements(NULL, searchPath, &numDirs, &dir); + TclListObjGetElements(NULL, searchPath, &numDirs, &dir); Tcl_IncrRefCount(nameObj); Tcl_AppendToObj(fileNameObj, ".enc", -1); Tcl_IncrRefCount(fileNameObj); @@ -3680,7 +3680,7 @@ InitializeEncodingSearchPath( Tcl_IncrRefCount(searchPathObj); libPathObj = TclGetLibraryPath(); Tcl_IncrRefCount(libPathObj); - Tcl_ListObjLength(NULL, libPathObj, &numDirs); + TclListObjLength(NULL, libPathObj, &numDirs); for (i = 0; i < numDirs; i++) { Tcl_Obj *directoryObj, *pathObj; |