Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1808764
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:18:13+00:00 2026-05-17T06:18:13+00:00

CPath = (CPath == null) ? Request.Path : CPath; First of all I wish

  • 0
CPath = (CPath == null) ? Request.Path : CPath;

First of all I wish CLR would just let me do the ? Request.Path and not bother me with creating a :

But I’m asking will it optimize it away? Or still assign.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:18:13+00:00Added an answer on May 17, 2026 at 6:18 am

    Well, I would personally write that as:

    if (CPath == null)
    {
        CPath = Request.Path;
    }
    

    to make it clearer. An alternative (as mentioned elsewhere) is

    CPath = CPath ?? Request.Path;
    

    But why do you care if there’s an extra assignment? Do you really think that’s going to be a significant performance hit?

    Note that if CPath is a field rather than a local variable, it could potentially make a difference – because the value of CPath could change between the first check and the second evaluation, and again between the evaluation and the assignment. Whether that will be noticed depends on caching etc, but it’s not as simple as it might look at first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First of all excuse me for my english. This is my first question here.
I tried this: DIR=/path/tar/*.gz if [ $(ls -A $DIR 2> /dev/null) == ]; then
CREATE TABLE CMCAPACITY(CMPATH VARCHAR(4000)NOT NULL, CAPACITY FLOAT(128), USAGE SMALLINT NOT NULL); I am getting
I'm trying to measure the performance impact of NGENing my assemblies versus not but
I have read other similar posts but I just don't understand what I've done
Just i am creating the database in my app. Now i follow the following
Why? C:\path\>manage.py shell Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit
I was searching for a way to insert an ellipsis in a C# path,
Whenever I try to use the python interpreter on windows, C:\path>pythonw.exe cubes.py <blank line>
How can i convert from a Unicode path name (LPWSTR) to the ASCII equivalent?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.