Skip to content

Commit

Permalink
Simplify logic
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Widgren <stefan.widgren@gmail.com>
  • Loading branch information
stewid committed Jan 5, 2018
1 parent e5136a0 commit 2130105
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/git2r_arg.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int git2r_arg_check_blob(SEXP arg)
{
SEXP class_name;

if (isNull(arg) || !isS4(arg))
if (!isS4(arg))
return -1;

class_name = getAttrib(arg, R_ClassSymbol);
Expand All @@ -56,7 +56,7 @@ int git2r_arg_check_branch(SEXP arg)
SEXP class_name;
SEXP slot;

if (isNull(arg) || !isS4(arg))
if (!isS4(arg))
return -1;

class_name = getAttrib(arg, R_ClassSymbol);
Expand Down Expand Up @@ -90,7 +90,7 @@ int git2r_arg_check_commit(SEXP arg)
{
SEXP class_name;

if (isNull(arg) || !isS4(arg))
if (!isS4(arg))
return -1;

class_name = getAttrib(arg, R_ClassSymbol);
Expand Down Expand Up @@ -195,7 +195,7 @@ int git2r_arg_check_fetch_heads(SEXP arg)
SEXP class_name;
SEXP item = VECTOR_ELT(arg, i);

if (isNull(item) || !isS4(item))
if (!isS4(item))
return -1;

class_name = getAttrib(item, R_ClassSymbol);
Expand Down Expand Up @@ -338,7 +338,7 @@ int git2r_arg_check_note(SEXP arg)
{
SEXP class_name;

if (isNull(arg) || !isS4(arg))
if (!isS4(arg))
return -1;

class_name = getAttrib(arg, R_ClassSymbol);
Expand Down Expand Up @@ -381,7 +381,7 @@ int git2r_arg_check_signature(SEXP arg)
SEXP class_name;
SEXP when;

if (isNull(arg) || !isS4(arg))
if (!isS4(arg))
return -1;

class_name = getAttrib(arg, R_ClassSymbol);
Expand Down Expand Up @@ -481,7 +481,7 @@ int git2r_arg_check_tag(SEXP arg)
{
SEXP class_name;

if (isNull(arg) || !isS4(arg))
if (!isS4(arg))
return -1;

class_name = getAttrib(arg, R_ClassSymbol);
Expand All @@ -504,7 +504,7 @@ int git2r_arg_check_tree(SEXP arg)
{
SEXP class_name;

if (isNull(arg) || !isS4(arg))
if (!isS4(arg))
return -1;

class_name = getAttrib(arg, R_ClassSymbol);
Expand Down

0 comments on commit 2130105

Please sign in to comment.