You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Knut Anders Hatlen (JIRA)" <ji...@apache.org> on 2008/07/25 11:47:31 UTC

[jira] Created: (DERBY-3798) Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()

Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()
---------------------------------------------------------------------------------

                 Key: DERBY-3798
                 URL: https://issues.apache.org/jira/browse/DERBY-3798
             Project: Derby
          Issue Type: Improvement
          Components: Newcomer, SQL
    Affects Versions: 10.5.0.0
            Reporter: Knut Anders Hatlen
            Priority: Trivial


I came across this piece of code in TableScanResultSet.getNextRowCore():

						if (past2FutureTbl.get(rowLoc) != null)
						{
							past2FutureTbl.remove(rowLoc);
							continue;
						}

I believe the call to Hashtable.get() is unnecessary since Hashtable.remove() returns the object it removed or null if the key was not in the table. So I believe the code could be simplified like this without changing the behaviour:

    if (past2FutureTbl.remove(rowLoc) != null) {
        continue;
    }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-3798) Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()

Posted by "Junjie Peng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Junjie Peng closed DERBY-3798.
------------------------------


Thanks, Myrna.

> Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()
> ---------------------------------------------------------------------------------
>
>                 Key: DERBY-3798
>                 URL: https://issues.apache.org/jira/browse/DERBY-3798
>             Project: Derby
>          Issue Type: Improvement
>          Components: Newcomer, SQL
>    Affects Versions: 10.5.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Junjie Peng
>            Priority: Trivial
>             Fix For: 10.5.0.0
>
>         Attachments: derby-3798-1.patch, derby-3798-1.stat
>
>
> I came across this piece of code in TableScanResultSet.getNextRowCore():
> 						if (past2FutureTbl.get(rowLoc) != null)
> 						{
> 							past2FutureTbl.remove(rowLoc);
> 							continue;
> 						}
> I believe the call to Hashtable.get() is unnecessary since Hashtable.remove() returns the object it removed or null if the key was not in the table. So I believe the code could be simplified like this without changing the behaviour:
>     if (past2FutureTbl.remove(rowLoc) != null) {
>         continue;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-3798) Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()

Posted by "Junjie Peng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Junjie Peng updated DERBY-3798:
-------------------------------

    Attachment: derby-3798-1.stat
                derby-3798-1.patch

Hi, Knut.

I agree with you. I have do the change as you suggested.
Besides, remove an variable never used.

Please check it!


> Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()
> ---------------------------------------------------------------------------------
>
>                 Key: DERBY-3798
>                 URL: https://issues.apache.org/jira/browse/DERBY-3798
>             Project: Derby
>          Issue Type: Improvement
>          Components: Newcomer, SQL
>    Affects Versions: 10.5.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Junjie Peng
>            Priority: Trivial
>         Attachments: derby-3798-1.patch, derby-3798-1.stat
>
>
> I came across this piece of code in TableScanResultSet.getNextRowCore():
> 						if (past2FutureTbl.get(rowLoc) != null)
> 						{
> 							past2FutureTbl.remove(rowLoc);
> 							continue;
> 						}
> I believe the call to Hashtable.get() is unnecessary since Hashtable.remove() returns the object it removed or null if the key was not in the table. So I believe the code could be simplified like this without changing the behaviour:
>     if (past2FutureTbl.remove(rowLoc) != null) {
>         continue;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (DERBY-3798) Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()

Posted by "Junjie Peng (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Junjie Peng reassigned DERBY-3798:
----------------------------------

    Assignee: Junjie Peng

> Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()
> ---------------------------------------------------------------------------------
>
>                 Key: DERBY-3798
>                 URL: https://issues.apache.org/jira/browse/DERBY-3798
>             Project: Derby
>          Issue Type: Improvement
>          Components: Newcomer, SQL
>    Affects Versions: 10.5.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Junjie Peng
>            Priority: Trivial
>
> I came across this piece of code in TableScanResultSet.getNextRowCore():
> 						if (past2FutureTbl.get(rowLoc) != null)
> 						{
> 							past2FutureTbl.remove(rowLoc);
> 							continue;
> 						}
> I believe the call to Hashtable.get() is unnecessary since Hashtable.remove() returns the object it removed or null if the key was not in the table. So I believe the code could be simplified like this without changing the behaviour:
>     if (past2FutureTbl.remove(rowLoc) != null) {
>         continue;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (DERBY-3798) Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-3798?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren resolved DERBY-3798.
---------------------------------------

       Resolution: Fixed
    Fix Version/s: 10.5.0.0

I committed the patch with revision 686193.

> Remove unnecessary call to Hashtable.get() in TableScanResultSet.getNextRowCore()
> ---------------------------------------------------------------------------------
>
>                 Key: DERBY-3798
>                 URL: https://issues.apache.org/jira/browse/DERBY-3798
>             Project: Derby
>          Issue Type: Improvement
>          Components: Newcomer, SQL
>    Affects Versions: 10.5.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Junjie Peng
>            Priority: Trivial
>             Fix For: 10.5.0.0
>
>         Attachments: derby-3798-1.patch, derby-3798-1.stat
>
>
> I came across this piece of code in TableScanResultSet.getNextRowCore():
> 						if (past2FutureTbl.get(rowLoc) != null)
> 						{
> 							past2FutureTbl.remove(rowLoc);
> 							continue;
> 						}
> I believe the call to Hashtable.get() is unnecessary since Hashtable.remove() returns the object it removed or null if the key was not in the table. So I believe the code could be simplified like this without changing the behaviour:
>     if (past2FutureTbl.remove(rowLoc) != null) {
>         continue;
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.