<html>#2378: PreSync's HasAccess does not handle functions scheduled AS under an alias correctly
<table style='border-spacing: 1ex 0pt; '>
<tr><td style='text-align:right'> Reporter:</td><td>Roland Haas</td></tr>
<tr><td style='text-align:right'>   Status:</td><td>new</td></tr>
<tr><td style='text-align:right'>Milestone:</td><td></td></tr>
<tr><td style='text-align:right'>  Version:</td><td></td></tr>
<tr><td style='text-align:right'>     Type:</td><td>bug</td></tr>
<tr><td style='text-align:right'> Priority:</td><td>major</td></tr>
<tr><td style='text-align:right'>Component:</td><td>Carpet</td></tr>
</table>

<p>Has_Access is using a hash indexed by <code>current_function</code> which constructed from the thorn name and the function name in the <code>cFunctionData</code> passed to <code>CallFunction</code>. However for a schedule statement:</p>
<div class="codehilite"><pre><span></span>schedule TestReadWrite_TestC_A as TestReadWrite_TestC_A_2nd
</pre></div>


<p>this yields a string “TestReadWrite_TestC_A::TestReadWrite_TestC_A” which is not sufficient to distinguish the two different schedule blocks.</p>
<p>There does not seem to be anything in <code>cFunctionData</code> that would reveal the alias used. However there seems to be no need for the map that <code>hasAccess</code> uses anyway. <code>cFunctiondata</code> does contain the <code>RDWR</code> array and <code>hasAccess</code> could just search that array. Assuming the array is sorted by varindex (easily arranged when buidling it) then a binary search for an integer in an array of size of 10 or so (guessing the typically accessible number of variables for a scheduled function) rather than a binary tree walk in the map using a hundred of schedule items and a string compare.</p>
<p>‌</p>
<p>--<br/>
Ticket URL: <a href='https://bitbucket.org/einsteintoolkit/tickets/issues/2378/presyncs-hasaccess-does-not-handle'>https://bitbucket.org/einsteintoolkit/tickets/issues/2378/presyncs-hasaccess-does-not-handle</a></p>
</html>