fix wrong positioning of hash_string

This commit is contained in:
Stefan Frederik 2022-09-25 21:26:22 +02:00
parent fd72e72dba
commit 3f11b5fdf6
1 changed files with 12 additions and 12 deletions

View File

@ -2120,6 +2120,18 @@ proc is_xschem_file {f} {
return $ret return $ret
} }
proc hash_string {s} {
set hash 5381
set len [string length $s]
for {set i 0} { $i < $len} { incr i} {
set c [string index $s $i]
set ascii [scan $c %c]
set hash [expr {($hash + ($hash << 5) + $ascii)%4294967296} ]
}
return $hash
}
## Recent component toolbar ## Recent component toolbar
namespace eval c_toolbar { namespace eval c_toolbar {
# Create a variable inside the namespace # Create a variable inside the namespace
@ -2341,18 +2353,6 @@ proc load_file_dialog_up {dir} {
} }
proc hash_string {s} {
set hash 5381
set len [string length $s]
for {set i 0} { $i < $len} { incr i} {
set c [string index $s $i]
set ascii [scan $c %c]
set hash [expr {($hash + ($hash << 5) + $ascii)%4294967296} ]
}
return $hash
}
proc load_file_dialog {{msg {}} {ext {}} {global_initdir {INITIALINSTDIR}} proc load_file_dialog {{msg {}} {ext {}} {global_initdir {INITIALINSTDIR}}
{loadfile {1}} {confirm_overwrt {1}} {initialf {}}} { {loadfile {1}} {confirm_overwrt {1}} {initialf {}}} {
global myload_index1 myload_files2 myload_files1 myload_retval myload_dir1 pathlist OS global myload_index1 myload_files2 myload_files1 myload_retval myload_dir1 pathlist OS