Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: simplify gas_counter #3899

Merged
merged 1 commit into from
Feb 11, 2021
Merged

refactor: simplify gas_counter #3899

merged 1 commit into from
Feb 11, 2021

Conversation

matklad
Copy link
Contributor

@matklad matklad commented Feb 3, 2021

No description provided.

*f.borrow_mut() = 0;
});
ret
EVM_GAS_COUNTER.with(|f| f.replace(0))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jones's trick can simplify a lot of things. Many types have .replace method: https://doc.rust-lang.org/stable/std/?search=replace. There's also std::mem::replace.

@matklad matklad force-pushed the gas-features branch 2 times, most recently from 0a751c1 to fa4ca2f Compare February 3, 2021 17:13
@frol
Copy link
Collaborator

frol commented Feb 3, 2021

I have already restarted the db-migration CI test 4 times and it still fails. I don't expect this change to have any effect on the test, but it seems @matklad is super unlucky 😄

@matklad
Copy link
Contributor Author

matklad commented Feb 11, 2021

ping @evgenykuzyakov, I think this is blocked on review from you (although I might be missing some process here). If this looks good, I'll rebase.

@frol
Copy link
Collaborator

frol commented Feb 11, 2021

@matklad please, rebase, I will merge it since Evgeny is out of the office.

@matklad matklad force-pushed the gas-features branch 2 times, most recently from f713f54 to f77a2e1 Compare February 11, 2021 12:10
@matklad
Copy link
Contributor Author

matklad commented Feb 11, 2021

Ah! rebased @frol !

@matklad
Copy link
Contributor Author

matklad commented Feb 11, 2021

And now rebased properly

@frol frol merged commit 1cb9302 into near:master Feb 11, 2021
@matklad matklad deleted the gas-features branch February 11, 2021 14:39
github-merge-queue bot pushed a commit that referenced this pull request Oct 30, 2023
<p>This PR was automatically created by Snyk using the credentials of a
real user.</p><br /><h3>Snyk has created this PR to upgrade react-query
from 3.39.2 to 3.39.3.</h3>

:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>

- The recommended version is **1 version** ahead of your current
version.
- The recommended version was released **9 months ago**, on 2023-01-25.

<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>react-query</b></summary>
    <ul>
      <li>
        <b>3.39.3</b> - 2023-01-25
      </li>
      <li>
        <b>3.39.2</b> - 2022-07-15
      </li>
    </ul>
from <a
href="https://snyk.io/redirect/github/tannerlinsley/react-query/releases">react-query
GitHub release notes</a>
  </details>
</details>

<details>
  <summary><b>Commit messages</b></summary>
  </br>
  <details>
    <summary>Package name: <b>react-query</b></summary>
    <ul>
<li><a
href="https://snyk.io/redirect/github/TanStack/query/commit/ef684205cb4890db904db5b387513fb9042e0bb6">ef68420</a>
fix: deprecation notice</li>
<li><a
href="https://snyk.io/redirect/github/TanStack/query/commit/8be8aed7585a7087fc371479f0b7c31bc928d2e4">8be8aed</a>
fix: Add Deprecation Notice</li>
<li><a
href="https://snyk.io/redirect/github/TanStack/query/commit/8487aeb644ef059e0ecc4dd934959af3bcd1ba2c">8487aeb</a>
docs: force update</li>
<li><a
href="https://snyk.io/redirect/github/TanStack/query/commit/2ac2a56ebfa087cf342a51333f4d8012e1f289cb">2ac2a56</a>
docs: force update</li>
<li><a
href="https://snyk.io/redirect/github/TanStack/query/commit/bb6f34a6e9d329dcfd7612b752d5e8a62395bf30">bb6f34a</a>
docs: update readme</li>
<li><a
href="https://snyk.io/redirect/github/TanStack/query/commit/5e37b145a8836b00dd20860e8eb1f94c608fec81">5e37b14</a>
docs: Updating v3 example links (#4065)</li>
<li><a
href="https://snyk.io/redirect/github/TanStack/query/commit/4c066e2ac58c93214fb8ce4d20859bf107fa602b">4c066e2</a>
docs: point resources to v3 instead of master (#3899)</li>
<li><a
href="https://snyk.io/redirect/github/TanStack/query/commit/4900d8c4b7fca5423eee809c8ee57353168e9f9f">4900d8c</a>
docs: make examples point to v3 instead of main (#3885)</li>
    </ul>

<a
href="https://snyk.io/redirect/github/TanStack/query/compare/8a332bd05037497e12055a60dafd75b28daef317...ef684205cb4890db904db5b387513fb9042e0bb6">Compare</a>
  </details>
</details>
<hr/>

**Note:** *You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs.*

For more information: <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiIyODRjNDFlZS1hMWFhLTRiMzAtODA0Mi1mZDQ0ZjJjMDRiZjMiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6IjI4NGM0MWVlLWExYWEtNGIzMC04MDQyLWZkNDRmMmMwNGJmMyJ9fQ=="
width="0" height="0"/>

🧐 [View latest project
report](https://app.snyk.io/org/pagoda-pilot/project/12e75fec-70e5-4998-8926-9b5a6351ba5f?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/pagoda-pilot/project/12e75fec-70e5-4998-8926-9b5a6351ba5f/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/pagoda-pilot/project/12e75fec-70e5-4998-8926-9b5a6351ba5f/settings/integration?pkg&#x3D;react-query&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

<!---
(snyk:metadata:{"prId":"284c41ee-a1aa-4b30-8042-fd44f2c04bf3","prPublicId":"284c41ee-a1aa-4b30-8042-fd44f2c04bf3","dependencies":[{"name":"react-query","from":"3.39.2","to":"3.39.3"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/pagoda-pilot/project/12e75fec-70e5-4998-8926-9b5a6351ba5f?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"12e75fec-70e5-4998-8926-9b5a6351ba5f","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":1,"publishedDate":"2023-01-25T19:44:56.696Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]})
--->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants