mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Replace "iff" with "if and only if"
iff means if and only if, but readers without that knowledge might assume this to be a spelling mistake. To me, this seems like exclusionary language that is unnecessary. Simply using "if and only if" instead should suffice.
This commit is contained in:
parent
a8dc5156e1
commit
9e0075a3d9
Notes:
git
2021-01-20 05:07:14 +09:00
17 changed files with 18 additions and 18 deletions
|
@ -167,7 +167,7 @@ RBIMPL_SYMBOL_EXPORT_END()
|
||||||
#define RUBY_ASSERT_ALWAYS(expr) RUBY_ASSERT_MESG((expr), #expr)
|
#define RUBY_ASSERT_ALWAYS(expr) RUBY_ASSERT_MESG((expr), #expr)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Asserts that the given expression is truthy iff #RUBY_DEBUG is truthy.
|
* Asserts that the given expression is truthy if and only if #RUBY_DEBUG is truthy.
|
||||||
*
|
*
|
||||||
* @param expr What supposedly evaluates to true.
|
* @param expr What supposedly evaluates to true.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
# define RBIMPL_ATTR_CONST() /* void */
|
# define RBIMPL_ATTR_CONST() /* void */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Enables #RBIMPL_ATTR_CONST iff. ! #RUBY_DEBUG. */
|
/** Enables #RBIMPL_ATTR_CONST if and only if. ! #RUBY_DEBUG. */
|
||||||
#if !RUBY_DEBUG
|
#if !RUBY_DEBUG
|
||||||
# define RBIMPL_ATTR_CONST_UNLESS_DEBUG() RBIMPL_ATTR_CONST()
|
# define RBIMPL_ATTR_CONST_UNLESS_DEBUG() RBIMPL_ATTR_CONST()
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
# define RBIMPL_ATTR_CONSTEXPR(_) /* void */
|
# define RBIMPL_ATTR_CONSTEXPR(_) /* void */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Enables #RBIMPL_ATTR_CONSTEXPR iff. ! #RUBY_DEBUG. */
|
/** Enables #RBIMPL_ATTR_CONSTEXPR if and only if. ! #RUBY_DEBUG. */
|
||||||
#if !RUBY_DEBUG
|
#if !RUBY_DEBUG
|
||||||
# define RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(_) RBIMPL_ATTR_CONSTEXPR(_)
|
# define RBIMPL_ATTR_CONSTEXPR_UNLESS_DEBUG(_) RBIMPL_ATTR_CONSTEXPR(_)
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
# define RBIMPL_ATTR_PURE() /* void */
|
# define RBIMPL_ATTR_PURE() /* void */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Enables #RBIMPL_ATTR_PURE iff. ! #RUBY_DEBUG. */
|
/** Enables #RBIMPL_ATTR_PURE if and only if. ! #RUBY_DEBUG. */
|
||||||
#if !RUBY_DEBUG
|
#if !RUBY_DEBUG
|
||||||
# define RBIMPL_ATTR_PURE_UNLESS_DEBUG() RBIMPL_ATTR_PURE()
|
# define RBIMPL_ATTR_PURE_UNLESS_DEBUG() RBIMPL_ATTR_PURE()
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -1821,7 +1821,7 @@ SRC
|
||||||
# without modifying any of the global values mentioned above.
|
# without modifying any of the global values mentioned above.
|
||||||
def pkg_config(pkg, option=nil)
|
def pkg_config(pkg, option=nil)
|
||||||
if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
|
if pkgconfig = with_config("#{pkg}-config") and find_executable0(pkgconfig)
|
||||||
# iff package specific config command is given
|
# if and only if package specific config command is given
|
||||||
elsif ($PKGCONFIG ||=
|
elsif ($PKGCONFIG ||=
|
||||||
(pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
|
(pkgconfig = with_config("pkg-config", ("pkg-config" unless CROSS_COMPILING))) &&
|
||||||
find_executable0(pkgconfig) && pkgconfig) and
|
find_executable0(pkgconfig) && pkgconfig) and
|
||||||
|
|
2
signal.c
2
signal.c
|
@ -723,7 +723,7 @@ sighandler(int sig)
|
||||||
rb_vm_t *vm = GET_VM();
|
rb_vm_t *vm = GET_VM();
|
||||||
ATOMIC_EXCHANGE(sigchld_hit, 1);
|
ATOMIC_EXCHANGE(sigchld_hit, 1);
|
||||||
|
|
||||||
/* avoid spurious wakeup in main thread iff nobody uses trap(:CHLD) */
|
/* avoid spurious wakeup in main thread if and only if nobody uses trap(:CHLD) */
|
||||||
if (vm && ACCESS_ONCE(VALUE, vm->trap_list.cmd[sig])) {
|
if (vm && ACCESS_ONCE(VALUE, vm->trap_list.cmd[sig])) {
|
||||||
signal_enque(sig);
|
signal_enque(sig);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ describe "GC.disable" do
|
||||||
GC.enable
|
GC.enable
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns true iff the garbage collection was previously disabled" do
|
it "returns true if and only if the garbage collection was previously disabled" do
|
||||||
GC.enable
|
GC.enable
|
||||||
GC.disable.should == false
|
GC.disable.should == false
|
||||||
GC.disable.should == true
|
GC.disable.should == true
|
||||||
|
|
|
@ -2,7 +2,7 @@ require_relative '../../spec_helper'
|
||||||
|
|
||||||
describe "GC.enable" do
|
describe "GC.enable" do
|
||||||
|
|
||||||
it "returns true iff the garbage collection was already disabled" do
|
it "returns true if and only if the garbage collection was already disabled" do
|
||||||
GC.enable
|
GC.enable
|
||||||
GC.enable.should == false
|
GC.enable.should == false
|
||||||
GC.disable
|
GC.disable
|
||||||
|
|
|
@ -118,7 +118,7 @@ describe :hash_eql_additional, shared: true do
|
||||||
{ 1.0 => "x" }.send(@method, { 1 => "x" }).should be_false
|
{ 1.0 => "x" }.send(@method, { 1 => "x" }).should be_false
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns true iff other Hash has the same number of keys and each key-value pair matches" do
|
it "returns true if and only if other Hash has the same number of keys and each key-value pair matches" do
|
||||||
a = { a: 5 }
|
a = { a: 5 }
|
||||||
b = {}
|
b = {}
|
||||||
a.send(@method, b).should be_false
|
a.send(@method, b).should be_false
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require_relative '../../spec_helper'
|
require_relative '../../spec_helper'
|
||||||
|
|
||||||
describe "Integer#allbits?" do
|
describe "Integer#allbits?" do
|
||||||
it "returns true iff all the bits of the argument are set in the receiver" do
|
it "returns true if and only if all the bits of the argument are set in the receiver" do
|
||||||
42.allbits?(42).should == true
|
42.allbits?(42).should == true
|
||||||
0b1010_1010.allbits?(0b1000_0010).should == true
|
0b1010_1010.allbits?(0b1000_0010).should == true
|
||||||
0b1010_1010.allbits?(0b1000_0001).should == false
|
0b1010_1010.allbits?(0b1000_0001).should == false
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require_relative '../../spec_helper'
|
require_relative '../../spec_helper'
|
||||||
|
|
||||||
describe "Integer#anybits?" do
|
describe "Integer#anybits?" do
|
||||||
it "returns true iff all the bits of the argument are set in the receiver" do
|
it "returns true if and only if all the bits of the argument are set in the receiver" do
|
||||||
42.anybits?(42).should == true
|
42.anybits?(42).should == true
|
||||||
0b1010_1010.anybits?(0b1000_0010).should == true
|
0b1010_1010.anybits?(0b1000_0010).should == true
|
||||||
0b1010_1010.anybits?(0b1000_0001).should == true
|
0b1010_1010.anybits?(0b1000_0001).should == true
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
require_relative '../../spec_helper'
|
require_relative '../../spec_helper'
|
||||||
|
|
||||||
describe "Integer#nobits?" do
|
describe "Integer#nobits?" do
|
||||||
it "returns true iff all no bits of the argument are set in the receiver" do
|
it "returns true if and only if all no bits of the argument are set in the receiver" do
|
||||||
42.nobits?(42).should == false
|
42.nobits?(42).should == false
|
||||||
0b1010_1010.nobits?(0b1000_0010).should == false
|
0b1010_1010.nobits?(0b1000_0010).should == false
|
||||||
0b1010_1010.nobits?(0b1000_0001).should == false
|
0b1010_1010.nobits?(0b1000_0001).should == false
|
||||||
|
|
2
st.c
2
st.c
|
@ -768,7 +768,7 @@ rebuild_table(st_table *tab)
|
||||||
guarantees traversing all table bins in extreme case.
|
guarantees traversing all table bins in extreme case.
|
||||||
|
|
||||||
According the Hull-Dobell theorem a generator
|
According the Hull-Dobell theorem a generator
|
||||||
"Xnext = (a*Xprev + c) mod m" is a full cycle generator iff
|
"Xnext = (a*Xprev + c) mod m" is a full cycle generator if and only if
|
||||||
o m and c are relatively prime
|
o m and c are relatively prime
|
||||||
o a-1 is divisible by all prime factors of m
|
o a-1 is divisible by all prime factors of m
|
||||||
o a-1 is divisible by 4 if m is divisible by 4.
|
o a-1 is divisible by 4 if m is divisible by 4.
|
||||||
|
|
2
thread.c
2
thread.c
|
@ -5149,7 +5149,7 @@ recursive_list_access(VALUE sym)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Returns Qtrue iff obj (or the pair <obj, paired_obj>) is already
|
* Returns Qtrue if and only if obj (or the pair <obj, paired_obj>) is already
|
||||||
* in the recursion list.
|
* in the recursion list.
|
||||||
* Assumes the recursion list is valid.
|
* Assumes the recursion list is valid.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2481,7 +2481,7 @@ rb_autoload_load(VALUE mod, ID id)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* autoload_reset will wake up any threads added to this
|
* autoload_reset will wake up any threads added to this
|
||||||
* iff the GVL is released during autoload_require
|
* if and only if the GVL is released during autoload_require
|
||||||
*/
|
*/
|
||||||
list_head_init((struct list_head *)&state.waitq);
|
list_head_init((struct list_head *)&state.waitq);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,7 @@ update_global_event_hook(rb_event_flag_t vm_events)
|
||||||
mjit_call_p = FALSE;
|
mjit_call_p = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* write all ISeqs iff new events are added */
|
/* write all ISeqs if and only if new events are added */
|
||||||
rb_iseq_trace_set_all(new_iseq_events | enabled_iseq_events);
|
rb_iseq_trace_set_all(new_iseq_events | enabled_iseq_events);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ struct __sbuf {
|
||||||
* _ub, _up, and _ur are used when ungetc() pushes back more characters
|
* _ub, _up, and _ur are used when ungetc() pushes back more characters
|
||||||
* than fit in the current _bf, or when ungetc() pushes back a character
|
* than fit in the current _bf, or when ungetc() pushes back a character
|
||||||
* that does not match the previous one in _bf. When this happens,
|
* that does not match the previous one in _bf. When this happens,
|
||||||
* _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
|
* _ub._base becomes non-nil (i.e., a stream has ungetc() data if and only if
|
||||||
* _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
|
* _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
|
||||||
*
|
*
|
||||||
* NB: see WARNING above before changing the layout of this structure!
|
* NB: see WARNING above before changing the layout of this structure!
|
||||||
|
@ -196,7 +196,7 @@ typedef struct __sFILE {
|
||||||
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
|
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
|
||||||
#define __SOPT 0x0400 /* do fseek() optimisation */
|
#define __SOPT 0x0400 /* do fseek() optimisation */
|
||||||
#define __SNPT 0x0800 /* do not do fseek() optimisation */
|
#define __SNPT 0x0800 /* do not do fseek() optimisation */
|
||||||
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
|
#define __SOFF 0x1000 /* set if and only if _offset is in fact correct */
|
||||||
#define __SMOD 0x2000 /* true => fgetln modified _p text */
|
#define __SMOD 0x2000 /* true => fgetln modified _p text */
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue