summaryrefslogtreecommitdiffhomepage
path: root/src/range.c
AgeCommit message (Collapse)Author
2019-09-26Use type predicate macros instead of `mrb_type` if possibleKOBAYASHI Shuji
For efficiency with `MRB_WORD_BOXING` (implement type predicate macros for all `enum mrb_vtype`).
2019-09-14Remove `mrb_funcall` from `<=>` operations.Yukihiro "Matz" Matsumoto
2019-09-14Use `mrb_equal` instead of `mrb_funcall`.Yukihiro "Matz" Matsumoto
In the typical case, `mrb_funcall` invocation would be skipped.
2019-08-05Use new specifiers/modifiers of `mrb_vfromat()`KOBAYASHI Shuji
The binary sizes (gems are only `mruby-bin-mruby`) are reduced slightly in my environment than before the introduction of new specifiers/modifiers (5116789a) with this change. ------------+-------------------+-------------------+-------- BINARY | BEFORE (5116789a) | AFTER (This PR) | RATIO ------------+-------------------+-------------------+-------- mruby | 593416 bytes | 593208 bytes | -0.04% libmruby.a | 769048 bytes | 767264 bytes | -0.23% ------------+-------------------+-------------------+-------- BTW, I accidentally changed `tasks/toolchains/visualcpp.rake` at #4613, so I put it back.
2019-06-28Remove unnecessary backticks in `src/range.c`; ref #2858KOBAYASHI Shuji
2019-05-25Name the return value of `mrb_range_beg_len()`dearblue
2019-01-04Remove unused local variable `n` in `range_initialize`; #4213Yukihiro "Matz" Matsumoto
2019-01-03range: Refactor range.h/range.cKOBAYASHI Shuji
Functions order, name, linkage and so on.
2019-01-01range: Embed edges in RRange on boxing environment.KOBAYASHI Shuji
[Breaking changes] Developers must use following APIs for accessing attributes of RRange because RRange structure depends on boxing setting. - mrb_range_beg - mrb_range_end - mrb_range_excl_p
2018-06-14Need to add a write barrier for ranges; fix #4042Yukihiro "Matz" Matsumoto
Ranges are almost immutable but `initialize` and `initialize_copy` modify the receiver so that we need to add a write barrier.
2017-10-11Add MRB_WITHOUT_FLOATYAMAMOTO Masaya
2017-09-27fix: src\range.c(136): warning C4244: '=': conversion from 'mrb_int' to ↵Tomasz Dąbrowski
'int', possible loss of data
2017-08-26Keep `Range` class in `mrb_state` structure for performance.Yukihiro "Matz" Matsumoto
2017-01-23Change return type of mrb_range_beg_len() from `int` to `mrb_int`.Yukihiro "Matz" Matsumoto
ref #3411
2017-01-23Add MRB_API to mrb_range_beg_len(); ref #3411Yukihiro "Matz" Matsumoto
2017-01-23Changed the behavior of mrb_range_beg_len(); close #3411Yukihiro "Matz" Matsumoto
The new API is: int mrb_range_beg_len(mrb, range, &beg, &len, len, trunc) The new argument `trunc` is a boolean value that specifies whether the function truncates the range. The new return value is an integer instead of a boolean, that is: 0: not a range 1: range with proper edges 2: out of range To get the old behavior, you have to rewrite: mrb_range_beg_len(mrb, range, &beg, &len, len) to: mrn_range_beg_len(mrb, range, &beg, &len, len, TRUE) == 1 [Breaking Change]
2016-12-13Check type before calling mrb_range_ptr.Clayton Smith
2016-12-03Check before retrieving struct RRange pointer; fix #3320Yukihiro "Matz" Matsumoto
range->edges may be NULL for example when #initialize_copy removed.
2016-11-18Range#include?: simplify condition; ref #3255Yukihiro "Matz" Matsumoto
2016-11-18Merge pull request #3255 from ksss/range-includeYukihiro "Matz" Matsumoto
Fix condition of Range#include?
2016-11-18Fix condition of Range#include?ksss
2016-11-17Ranges should not rewriteksss
2016-10-24macro mrb_bool() may evaluate arg multiple times; ref #3228Yukihiro "Matz" Matsumoto
2015-11-27include changed from by quotes ("") to by brackets (<>); close #3032Yukihiro "Matz" Matsumoto
2015-07-16use mrb_str_cat_str() instead of mrb_str_append()cremno
If the argument is always a string, then mrb_str_cat_str() can be directly called instead of indirectly by mrb_str_append(). mrb_any_to_s(), mrb_obj_as_string(), mrb_inspect() always return a string.
2014-08-16removed unused variable in range_beg_lengo kikuta
2014-08-04fix linkage of range_beg_len and mrb_range_beg_lencremno
2014-08-04add MRB_API modifiers to mruby API functionsYukihiro "Matz" Matsumoto
2014-05-18Change range_check before mrb_obj_alloc.yui-knk
2014-05-17Use boolean macro in mrb_range_initialize()Jun Hiroe
2014-05-03new macro mrb_int(mrb,x) to retrieve mrb_int from mrb_value with conversion ↵Yukihiro "Matz" Matsumoto
if needed
2014-05-03use proper length for mrb_get_values_at()Yukihiro "Matz" Matsumoto
separate mrb_range_beg_len() into two: the one truncates range into the sequence size, and the one does not. #values_at uses the latter.
2014-05-03reindent elseYukihiro "Matz" Matsumoto
2014-05-03convert range edges to integersYukihiro "Matz" Matsumoto
2014-05-03do not raise error in mrb_range_beg_len()Yukihiro "Matz" Matsumoto
2014-05-03raise TypeError instead of ArgumentError when argument of wrong type given ↵Yukihiro "Matz" Matsumoto
to the values_at
2014-05-03Merge branch 'values_at' of https://github.com/take-cheeze/mruby into ↵Yukihiro "Matz" Matsumoto
take-cheeze-values_at
2014-05-03remove each from range.cYukihiro "Matz" Matsumoto
2014-05-02Implement Struct#values_at and Array#values_at .take_cheeze
Add API `mrb_get_values_at()` to mruby/range.h .
2014-04-24range_init argument for exclude_end use mrb_boolksss
2014-04-24mrb_range_new excl flag use mrb_bool insteard of intksss
2014-04-15resolve conflictYukihiro "Matz" Matsumoto
2014-02-09Merge pull request #1674 from cremno/mrb_bool-FALSE-TRUEYukihiro "Matz" Matsumoto
use mrb_bool, FALSE and TRUE more
2014-02-08made mrb_define_class to return existing class, with heavy refactoringYukihiro "Matz" Matsumoto
2014-01-31use mrb_bool, FALSE and TRUE morecremno
It doesn't matter to me if one is using FALSE/TRUE instead of 1/0 but I prefer a type (alias) which emphasizes boolean vars to int. I changed 1/0 to FALSE/TRUE anyway.
2014-01-31clean up external symbolscremno
remove unused and unneeded: - sysexit_status - type (a global variable) add mrb_ prefix to: - codedump_all - class_instance_method_list - parser_dump make various functions static, incl.: - yyparse - make_exception
2014-01-02tiny word boxing optimizationcremno
2013-08-01remove unused inspect_rangeYukihiro "Matz" Matsumoto
2013-07-15Repalace int with mrb_bool because a return value is boolean.Jun Hiroe
2013-07-05Refactor mrb_range_beg_len() func in range.cJun Hiroe