るりまサーチ

最速Rubyリファレンスマニュアル検索!
46件ヒット [1-46件を表示] (0.015秒)
トップページ > クエリ:hash[x] > クエリ:compact[x]

別のキーワード

  1. _builtin hash
  2. hash []
  3. dbm to_hash
  4. matrix hash
  5. _builtin to_hash

ライブラリ

クラス

モジュール

検索結果

Hash#compact -> Hash (27311.0)

compact は自身から value が nil のもの取り除いた Hash を生成して返します。 compact! は自身から破壊的に value が nil のものを取り除き、変更が行われた場合は self を、そうでなければ nil を返します。

...
compact
は自身から value が nil のもの取り除いた Hash を生成して返します。 compact! は自身から破壊的に value が nil のものを取り除き、変更が行われた場合は self を、そうでなければ nil を返します。


//emlist[例][ruby]{
hash
= {a: 1...
..., b: nil, c: 3}
p hash.compact #=> {:a=>1, :c=>3}
p hash #=> {:a=>1, :b=>nil, :c=>3}
hash
.compact!
hash
#=> {:a=>1, :c=>3}
p hash.compact! #=> nil
//}

@see Array#compact...

GC.compact -> Hash (18202.0)

ヒープをコンパクションします。

...ヒープをコンパクションします。

詳細は15626を参照してください。

@see GC.verify_compaction_references...

Hash#compact! -> self | nil (15211.0)

compact は自身から value が nil のもの取り除いた Hash を生成して返します。 compact! は自身から破壊的に value が nil のものを取り除き、変更が行われた場合は self を、そうでなければ nil を返します。

...
compact
は自身から value が nil のもの取り除いた Hash を生成して返します。 compact! は自身から破壊的に value が nil のものを取り除き、変更が行われた場合は self を、そうでなければ nil を返します。


//emlist[例][ruby]{
hash
= {a: 1...
..., b: nil, c: 3}
p hash.compact #=> {:a=>1, :c=>3}
p hash #=> {:a=>1, :b=>nil, :c=>3}
hash
.compact!
hash
#=> {:a=>1, :c=>3}
p hash.compact! #=> nil
//}

@see Array#compact...

GC.verify_compaction_references(toward: nil, double_heap: nil) -> Hash (6213.0)

コンパクションの参照の一貫性を検証します。

...ークスタックにプッシュされて、
SEGV が起きるでしょう。

@param toward nil か :empty を指定します。
@param double_heap ヒープサイズを2倍にするかどうかを真偽値で指定します。

@return GC.compact の返り値と同じです。

@see GC.compact...

NEWS for Ruby 3.0.0 (84.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added...
...uto_compact= and GC.auto_compact have been added to control when compaction runs. Setting `auto_compact=` to `true` will cause compaction to occur during major collections. At the moment, compaction adds significant overhead to major collections, so please test first! 17176
* Hash
* Hash#tr...
...ansform_keys and Hash#transform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except has been added, which returns a hash excluding the given keys and their values. 15822
* IO
* IO#nonblock? now defaults to `true`. 16786
* IO#wait_readable, IO#wait_writable, IO#rea...

絞り込み条件を変える

Enumerator::Lazy (42.0)

map や select などのメソッドの遅延評価版を提供するためのクラス。

...nd_all
* reject
* grep, grep_v
* take, take_while
* drop, drop_while
* slice_before, slice_after, slice_when
* chunk, chunk_while
* uniq
* compact
* zip (※互換性のため、ブロックを渡さないケースのみlazy)

Lazyオブジェクトは、Enumerable#lazyメソッドによっ...
...
# 巨大な配列を確保しようとしてメモリを使い切ったりはしない
open("log.txt"){|f|
f.each_line.lazy.map{|line|
Hash
[line.split(/\t/).map{|s| s.split(/:/, 2)}]
}.select{|hash|
hash
["req"] =~ /GET/ && hash["status"] == "200"
}.each{|hash|
p hash
}
}
//}...

NEWS for Ruby 2.4.0 (42.0)

NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...になりました。
half には :even, :up, :down が指定可能です。 12548 12958 12953

* Hash
* Hash#compact, Hash#compact! を追加 11818
* Hash#transform_values Hash#transform_values! を追加 12512

* Integer
* Fixnum と Bignum は Integer に統合されまし...

NEWS for Ruby 2.7.0 (18.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ンを受け付けるように
なりました。 15751

* GC
* 新規メソッド
* ヒープをコンパクションするGC.compactメソッドが追加されました。
このメソッドはヒープの生きているオブジェクトをコンパクションして...
...のプラットフォームでrealpath(3)を使います。
これは大幅にパフォーマンスを改善します。 15797

* Hash
* 小さいHashオブジェクトのデータ構造が変わりました。 15602

* Monitor
* MonitorクラスがC拡張になりました。 1625...