/** rb_ary_clear * */ @JRubyMethod(name = "clear") public IRubyObject rb_clear() { modifyCheck(); if (isShared) { alloc(ARRAY_DEFAULT_SIZE); isShared = false; } else if (values.length > ARRAY_DEFAULT_SIZE << 1) { alloc(ARRAY_DEFAULT_SIZE << 1); } else { try { begin = 0; Helpers.fillNil(values, 0, realLength, getRuntime()); } catch (ArrayIndexOutOfBoundsException e) { concurrentModification(); } } realLength = 0; return this; }
/** rb_ary_clear * */ @JRubyMethod(name = "clear") public IRubyObject rb_clear() { modifyCheck(); if (isShared) { alloc(ARRAY_DEFAULT_SIZE); isShared = false; } else if (values.length > ARRAY_DEFAULT_SIZE << 1) { alloc(ARRAY_DEFAULT_SIZE << 1); } else { try { begin = 0; Helpers.fillNil(values, 0, realLength, getRuntime()); } catch (ArrayIndexOutOfBoundsException e) { concurrentModification(); } } realLength = 0; return this; }
/** rb_ary_clear * */ @JRubyMethod(name = "clear") public IRubyObject rb_clear() { modifyCheck(); if (isShared) { alloc(ARRAY_DEFAULT_SIZE); isShared = false; } else if (values.length > ARRAY_DEFAULT_SIZE << 1) { alloc(ARRAY_DEFAULT_SIZE << 1); } else { try { begin = 0; Helpers.fillNil(values, 0, realLength, getRuntime()); } catch (ArrayIndexOutOfBoundsException e) { throw concurrentModification(getRuntime(), e); } } realLength = 0; return this; }
/** rb_ary_clear * */ @JRubyMethod(name = "clear") public IRubyObject rb_clear() { modifyCheck(); if (isShared) { alloc(ARRAY_DEFAULT_SIZE); isShared = false; } else if (values.length > ARRAY_DEFAULT_SIZE << 1) { alloc(ARRAY_DEFAULT_SIZE << 1); } else { try { begin = 0; Helpers.fillNil(values, 0, realLength, getRuntime()); } catch (ArrayIndexOutOfBoundsException e) { throw concurrentModification(getRuntime(), e); } } realLength = 0; return this; }