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

  • SEARCH
  • Home
  • 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 343975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:56:51+00:00 2026-05-12T10:56:51+00:00

I am not expecting a definite yes or no. Any knowledge you might have

  • 0

I am not expecting a definite yes or no. Any knowledge you might have I will consider as an answer.

private String CalculateCharge(Nullable<Decimal> bill, Nullable<Decimal> rate)
{
    return ((bill ?? 0.0m) * (rate ?? 0.0m)).ToString("C");
}
  • 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-12T10:56:52+00:00Added an answer on May 12, 2026 at 10:56 am

    Inlining is an implementation detail of the JIT, not of the C# compiler. From Eric Gunnerson’s blog:

    The JIT uses a number of heuristics to
    decide whether a method should be
    in-lined.
    The following is a list of
    the more significant of those (note
    that this is not exhaustive):

    • Methods that are greater than 32 bytes of IL will not be inlined.
    • Virtual functions are not inlined.
    • Methods that have complex flow control will not be in-lined. Complex
      flow control is any flow control other
      than if/then/else; in this case,
      switch or while.
    • Methods that contain exception-handling blocks are not
      inlined, though methods that throw
      exceptions are still candidates for
      inlining.
    • If any of the method’s formal arguments are structs, the method will
      not be inlined.

    Although your method is quite short and not very complex so it might match the heuristics, Nullable<T> is a struct so I’d guess your method is not inlined.

    As a rule of thumb, if inlining this method improves performance, the JIT will inline this method; otherwise it will not. But this is really an implementation detail of the JIT and nothing you should code for:

    I would carefully consider explicitly coding for these heuristics because they might change in future versions of the JIT. Don’t compromise the correctness of the method to attempt to guarantee that it will be inlined.

    EDIT: Apparently the bit about structs not being inlined is out-of-date; updated information can be found at Vance Morrison’s blog.

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

Sidebar

Related Questions

My IDE is expecting a semicolon but I'm not sure where! It is this
Why does the following code not work as I was expecting? <?php $data =
I am getting unexpected T_TRY, expecting T_FUNCTION error message and am not sure as
I just hooked together Apache and SVN. Not sure what I was expecting, but
After logged in successfully, Yii does not executing any page. Showing an error: Error
I'm elaborating over a problem which seems hard to me and I'm not expecting
I am not looking for any alternative of streaming file contents from database, indeed
I have a service defined as follows. public String getData(@QueryParam(date) Date date) I'm trying
Are there any direct consequences of toggling between Unicode , MBCS , and Not
I'm getting an anonymous class at compile-time that I'm not expecting. Relevant code follows,

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.