Skip to content

Comment on Ruby 2.1: Profiling Rubyparent

Comments

I haven't done too much Ruby myself, but the line looks sufficiently Perl like I believe the subtle change converted the first line (rolled out) from:

(excusing my Perl-Ruby mashup)

  if (params[:user_id].present){
    if (!@owner){
      @owner = User.find_by_login(params[:user_id]);
    }
  }
to:
  if (!@owner){
    if (params[:user_id].present){
      @owner = User.find_by_login(params[:user_id]);
    }
  }
Now the call params[:user_id].present is only made if @owner lacks a value.
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.