🚀 optimize code

This commit is contained in:
ValKmjolnir
2022-08-08 22:10:51 +08:00
parent 7ddb8593ad
commit 0493e18d0e
4 changed files with 7 additions and 5 deletions
+1 -2
View File
@@ -34,8 +34,7 @@ nasal_import::nasal_import(nasal_err& e):lib_loaded(false),nerr(e){
char sep=':';
#endif
string PATH=getenv("PATH");
usize last=0;
usize pos=PATH.find(sep,last);
usize last=0,pos=PATH.find(sep,0);
while(pos!=string::npos)
{
string dirpath=PATH.substr(last,pos-last);