get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/2226199/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2226199,
    "url": "http://patchwork.ozlabs.org/api/patches/2226199/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.6@forge-stage.sourceware.org/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/projects/17/?format=api",
        "name": "GNU Compiler Collection",
        "link_name": "gcc",
        "list_id": "gcc-patches.gcc.gnu.org",
        "list_email": "gcc-patches@gcc.gnu.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.6@forge-stage.sourceware.org>",
    "list_archive_url": null,
    "date": "2026-04-22T10:25:15",
    "name": "[v1,06/12] libstdc++: Replace _Hashtable::__fwd_value_for with cast",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "90c3afd373eb167ea233c32a770ec9fe70986284",
    "submitter": {
        "id": 93210,
        "url": "http://patchwork.ozlabs.org/api/people/93210/?format=api",
        "name": "Jonathan Wakely via Sourceware Forge",
        "email": "forge-bot+redi@forge-stage.sourceware.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.6@forge-stage.sourceware.org/mbox/",
    "series": [
        {
            "id": 500966,
            "url": "http://patchwork.ozlabs.org/api/series/500966/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=500966",
            "date": "2026-04-22T10:25:11",
            "name": "WIP: libstdc++: Refactor hash table code",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500966/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2226199/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2226199/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)",
            "sourceware.org; dmarc=none (p=none dis=none)\n header.from=forge-stage.sourceware.org",
            "sourceware.org;\n spf=pass smtp.mailfrom=forge-stage.sourceware.org",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=38.145.34.39"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g0wjP480Mz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 20:40:25 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 43E5E42FA7B8\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 22 Apr 2026 10:40:23 +0000 (GMT)",
            "from forge-stage.sourceware.org (vm08.sourceware.org [38.145.34.39])\n by sourceware.org (Postfix) with ESMTPS id 62AA74BBCDD8\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:26:17 +0000 (GMT)",
            "from forge-stage.sourceware.org (localhost [IPv6:::1])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256)\n (No client certificate requested)\n by forge-stage.sourceware.org (Postfix) with ESMTPS id 08527405A5\n for <gcc-patches@gcc.gnu.org>; Wed, 22 Apr 2026 10:26:15 +0000 (UTC)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 43E5E42FA7B8",
            "OpenDKIM Filter v2.11.0 sourceware.org 62AA74BBCDD8"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 62AA74BBCDD8",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 62AA74BBCDD8",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776853577; cv=none;\n b=usi0LhU58vLhLM1dd43jg+kezgM2cQs4aq4/PuBLoGN0PNpsVkr4iBPVIuD6mHWAqiAqjuEAm0tFSvRxrrcOZD2FpHr/i22meBBobg336SAwaWC2IKQ4pCJTeVw+UYt0XZDf7S/UKhfKXztyUP/z8Bl5G19EMUUYgmU18gl+g1E=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776853577; c=relaxed/simple;\n bh=mcorow0A2rJEDpwpDLOJJpw6uvbDK5fgrwiMeUcHUjs=;\n h=From:Date:Subject:MIME-Version:To:Message-ID;\n b=f/xFfxeU/x6kYezb8Qz5bRT4sNi9CZiSUg/4o2Lq+NLGNO/pKLVNZLinTI7V2iTpiDHJurNOXIx+VJ6CkhMqTuockn8x/gVjmbx3rXS0sL4zkf0VJPDtW74f181ZKU9BNNxWy0xCKVvttJwsRLInh7oRdkvoo1/1ckaTVDKAqvg=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "From": "Jonathan Wakely via Sourceware Forge\n <forge-bot+redi@forge-stage.sourceware.org>",
        "Date": "Wed, 22 Apr 2026 10:25:15 +0000",
        "Subject": "[PATCH v1 06/12] libstdc++: Replace _Hashtable::__fwd_value_for with\n cast",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>",
        "Message-ID": "\n <bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.6@forge-stage.sourceware.org>",
        "X-Mailer": "batrachomyomachia",
        "X-Requested-Reviewer": "fdumont",
        "X-Pull-Request-Organization": "gcc",
        "X-Pull-Request-Repository": "gcc-TEST",
        "X-Pull-Request": "https://forge.sourceware.org/gcc/gcc-TEST/pulls/15",
        "References": "\n <bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.0@forge-stage.sourceware.org>",
        "In-Reply-To": "\n <bmm.hhub8n5f78.gcc.gcc-TEST.redi.15.1.0@forge-stage.sourceware.org>",
        "X-Patch-URL": "\n https://forge.sourceware.org/redi/gcc/commit/1c48e98a81347b41cbe5fdef6d69e886ab029f51",
        "X-BeenThere": "gcc-patches@gcc.gnu.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>",
        "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>",
        "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>",
        "List-Post": "<mailto:gcc-patches@gcc.gnu.org>",
        "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>",
        "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>",
        "Reply-To": "gcc-patches mailing list <gcc-patches@gcc.gnu.org>, redi@gcc.gnu.org",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "From: Jonathan Wakely <jwakely@redhat.com>\n\nWe can just use a cast to the appropriate type instead of calling a\nfunction to do it. This gives the compiler less work to compile and\noptimize, and at -O0 avoids a function call per element.\n\nlibstdc++-v3/ChangeLog:\n\n\t* include/bits/hashtable.h (_Hashtable::__fwd_value_for):\n\tRemove.\n\t(_Hashtable::_M_assign): Use static_cast instead of\n\t__fwd_value_for.\n\nReviewed-by: François Dumont <fdumont@gcc.gnu.org>\n---\n libstdc++-v3/include/bits/hashtable.h | 14 +++++---------\n 1 file changed, 5 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/libstdc++-v3/include/bits/hashtable.h b/libstdc++-v3/include/bits/hashtable.h\nindex bf6eed7c1c69..f1c30896bcb0 100644\n--- a/libstdc++-v3/include/bits/hashtable.h\n+++ b/libstdc++-v3/include/bits/hashtable.h\n@@ -325,13 +325,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \t__node_ptr _M_node;\n       };\n \n-      template<typename _Ht>\n-\tstatic constexpr\n-\t__conditional_t<std::is_lvalue_reference<_Ht>::value,\n-\t\t\tconst value_type&, value_type&&>\n-\t__fwd_value_for(value_type& __val) noexcept\n-\t{ return std::move(__val); }\n-\n       // Compile-time diagnostics.\n \n       // _Hash_code_base has everything protected, so use this derived type to\n@@ -1406,11 +1399,14 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \t    if (!__ht._M_before_begin._M_nxt)\n \t      return;\n \n+\t    using _FromVal = __conditional_t<is_lvalue_reference<_Ht>::value,\n+\t\t\t\t\t     const value_type&, value_type&&>;\n+\n \t    // First deal with the special first node pointed to by\n \t    // _M_before_begin.\n \t    __node_ptr __ht_n = __ht._M_begin();\n \t    __node_ptr __this_n\n-\t      = __node_gen(__fwd_value_for<_Ht>(__ht_n->_M_v()));\n+\t      = __node_gen(static_cast<_FromVal>(__ht_n->_M_v()));\n \t    this->_M_copy_code(*__this_n, *__ht_n);\n \t    _M_update_bbegin(__this_n);\n \n@@ -1418,7 +1414,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION\n \t    __node_ptr __prev_n = __this_n;\n \t    for (__ht_n = __ht_n->_M_next(); __ht_n; __ht_n = __ht_n->_M_next())\n \t      {\n-\t\t__this_n = __node_gen(__fwd_value_for<_Ht>(__ht_n->_M_v()));\n+\t\t__this_n = __node_gen(static_cast<_FromVal>(__ht_n->_M_v()));\n \t\t__prev_n->_M_nxt = __this_n;\n \t\tthis->_M_copy_code(*__this_n, *__ht_n);\n \t\tsize_type __bkt = _M_bucket_index(*__this_n);\n",
    "prefixes": [
        "v1",
        "06/12"
    ]
}