⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.93
Server IP:
65.108.141.171
Server:
Linux server.heloix.com 5.4.0-214-generic #234-Ubuntu SMP Fri Mar 14 23:50:27 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
7.4.33
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
ri
/
2.7.0
/
system
/
Hash
/
Edit File: invert-i.ri
U:RDoc::AnyMethod[iI"invert:ETI"Hash#invert;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [ I"JReturns a new hash created by using <i>hsh</i>'s values as keys, and ;TI"the keys as values. ;TI"IIf a key with the same value already exists in the <i>hsh</i>, then ;TI"Othe last one defined will be used, the earlier value(s) will be discarded.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"Fh = { "n" => 100, "m" => 100, "y" => 300, "d" => 200, "a" => 0 } ;TI";h.invert #=> {0=>"a", 100=>"m", 200=>"d", 300=>"y"} ;T:@format0o; ; [I"GIf there is no key with the same value, Hash#invert is involutive.;T@o;; [I"h = { a: 1, b: 3, c: 4 } ;TI"#h.invert.invert == h #=> true ;T; 0o; ; [I"KThe condition, no key with the same value, can be tested by comparing ;TI"the size of inverted hash.;T@o;; [I""# no key with the same value ;TI"h = { a: 1, b: 3, c: 4 } ;TI"&h.size == h.invert.size #=> true ;TI" ;TI"-# two (or more) keys has the same value ;TI"h = { a: 1, b: 3, c: 1 } ;TI"&h.size == h.invert.size #=> false;T; 0: @fileI"hash.c;T:0@omit_headings_from_table_of_contents_below0I"hsh.invert -> new_hash ;T0[ I"();T@*FI" Hash;TcRDoc::NormalClass00
Simpan